Skip to content

Commit

Permalink
Fix NPE, add MountTrait, fix 1.10 looking
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Nov 26, 2016
1 parent 2bd7124 commit deffc24
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public AdminCommands(Citizens plugin) {
}

@Command(aliases = { "citizens" }, desc = "Show basic plugin information", max = 0, permission = "citizens.admin")
public void citizens(CommandContext args, CommandSender sender, NPC npc) {
public void citizens(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
Messaging.send(sender,
" " + StringHelper.wrapHeader("<e>Citizens v" + plugin.getDescription().getVersion()));
Messaging.send(sender, " <7>-- <c>Written by fullwall and aPunch");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.trait.ArmorStandTrait;
import net.citizensnpcs.trait.LookClose;
import net.citizensnpcs.trait.MountTrait;
import net.citizensnpcs.util.NMS;

public class CitizensNPCRegistry implements NPCRegistry {
Expand Down Expand Up @@ -58,6 +59,7 @@ public NPC createNPC(EntityType type, UUID uuid, int id, String name) {
if (Setting.DEFAULT_LOOK_CLOSE.asBoolean()) {
npc.addTrait(LookClose.class);
}
npc.addTrait(MountTrait.class);
return npc;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ private void setStrategy() {

@Override
public void stop() {
strategy.stop();
if (strategy != null) {
strategy.stop();
}
}

@Override
Expand Down
1 change: 0 additions & 1 deletion main/src/main/java/net/citizensnpcs/trait/MountTrait.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public void run() {
NMS.mount(other.getEntity(), npc.getEntity());
}
}

if (NMS.getVehicle(npc.getEntity()) instanceof NPCHolder) {
mountedOn = ((NPCHolder) NMS.getVehicle(npc.getEntity())).getNPC().getUniqueId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public void m() {
}
moveOnCurrentHeading();
}
NMSImpl.updateAI(this);

if (noDamageTicks > 0) {
--noDamageTicks;
Expand All @@ -319,7 +320,6 @@ public boolean m_() {
}

private void moveOnCurrentHeading() {
NMSImpl.updateAI(this);
if (be) {
if (onGround && jumpTicks == 0) {
cl();
Expand Down

0 comments on commit deffc24

Please sign in to comment.