mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-22 23:31:31 +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")
|
@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,
|
Messaging.send(sender,
|
||||||
" " + StringHelper.wrapHeader("<e>Citizens v" + plugin.getDescription().getVersion()));
|
" " + StringHelper.wrapHeader("<e>Citizens v" + plugin.getDescription().getVersion()));
|
||||||
Messaging.send(sender, " <7>-- <c>Written by fullwall and aPunch");
|
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.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.trait.ArmorStandTrait;
|
import net.citizensnpcs.trait.ArmorStandTrait;
|
||||||
import net.citizensnpcs.trait.LookClose;
|
import net.citizensnpcs.trait.LookClose;
|
||||||
|
import net.citizensnpcs.trait.MountTrait;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
|
|
||||||
public class CitizensNPCRegistry implements NPCRegistry {
|
public class CitizensNPCRegistry implements NPCRegistry {
|
||||||
@ -58,6 +59,7 @@ public class CitizensNPCRegistry implements NPCRegistry {
|
|||||||
if (Setting.DEFAULT_LOOK_CLOSE.asBoolean()) {
|
if (Setting.DEFAULT_LOOK_CLOSE.asBoolean()) {
|
||||||
npc.addTrait(LookClose.class);
|
npc.addTrait(LookClose.class);
|
||||||
}
|
}
|
||||||
|
npc.addTrait(MountTrait.class);
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,9 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
strategy.stop();
|
if (strategy != null) {
|
||||||
|
strategy.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,7 +29,6 @@ public class MountTrait extends Trait {
|
|||||||
NMS.mount(other.getEntity(), npc.getEntity());
|
NMS.mount(other.getEntity(), npc.getEntity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NMS.getVehicle(npc.getEntity()) instanceof NPCHolder) {
|
if (NMS.getVehicle(npc.getEntity()) instanceof NPCHolder) {
|
||||||
mountedOn = ((NPCHolder) NMS.getVehicle(npc.getEntity())).getNPC().getUniqueId();
|
mountedOn = ((NPCHolder) NMS.getVehicle(npc.getEntity())).getNPC().getUniqueId();
|
||||||
}
|
}
|
||||||
|
@ -301,6 +301,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
}
|
}
|
||||||
moveOnCurrentHeading();
|
moveOnCurrentHeading();
|
||||||
}
|
}
|
||||||
|
NMSImpl.updateAI(this);
|
||||||
|
|
||||||
if (noDamageTicks > 0) {
|
if (noDamageTicks > 0) {
|
||||||
--noDamageTicks;
|
--noDamageTicks;
|
||||||
@ -319,7 +320,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void moveOnCurrentHeading() {
|
private void moveOnCurrentHeading() {
|
||||||
NMSImpl.updateAI(this);
|
|
||||||
if (be) {
|
if (be) {
|
||||||
if (onGround && jumpTicks == 0) {
|
if (onGround && jumpTicks == 0) {
|
||||||
cl();
|
cl();
|
||||||
|
Loading…
Reference in New Issue
Block a user