mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-22 15:22:11 +01:00
Fix NPE, add MountTrait, fix 1.10 looking
This commit is contained in:
parent
2bd712434d
commit
deffc24bb7
@ -22,7 +22,7 @@ public class AdminCommands {
|
||||
}
|
||||
|
||||
@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");
|
||||
|
@ -27,6 +27,7 @@ import net.citizensnpcs.api.trait.Trait;
|
||||
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 {
|
||||
@ -58,6 +59,7 @@ public class CitizensNPCRegistry implements NPCRegistry {
|
||||
if (Setting.DEFAULT_LOOK_CLOSE.asBoolean()) {
|
||||
npc.addTrait(LookClose.class);
|
||||
}
|
||||
npc.addTrait(MountTrait.class);
|
||||
return npc;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,9 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
strategy.stop();
|
||||
if (strategy != null) {
|
||||
strategy.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +29,6 @@ public class MountTrait extends Trait {
|
||||
NMS.mount(other.getEntity(), npc.getEntity());
|
||||
}
|
||||
}
|
||||
|
||||
if (NMS.getVehicle(npc.getEntity()) instanceof NPCHolder) {
|
||||
mountedOn = ((NPCHolder) NMS.getVehicle(npc.getEntity())).getNPC().getUniqueId();
|
||||
}
|
||||
|
@ -301,6 +301,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
moveOnCurrentHeading();
|
||||
}
|
||||
NMSImpl.updateAI(this);
|
||||
|
||||
if (noDamageTicks > 0) {
|
||||
--noDamageTicks;
|
||||
@ -319,7 +320,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void moveOnCurrentHeading() {
|
||||
NMSImpl.updateAI(this);
|
||||
if (be) {
|
||||
if (onGround && jumpTicks == 0) {
|
||||
cl();
|
||||
|
Loading…
Reference in New Issue
Block a user