diff --git a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java index 9b54ce085..448d38382 100644 --- a/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java +++ b/main/src/main/java/net/citizensnpcs/commands/NPCCommands.java @@ -433,7 +433,7 @@ public class NPCCommands { throw new NoPermissionsException(); npc = CitizensAPI.getNPCRegistry().createNPC(type, name); - String msg = "You created [[" + npc.getName() + "]]"; + String msg = "You created [[" + npc.getName() + "]] (ID [[" + npc.getId() + "]])"; int age = 0; if (args.hasFlag('b')) { @@ -857,11 +857,11 @@ public class NPCCommands { } Paginator paginator = new Paginator().header("NPCs").console(sender instanceof ConsoleCommandSender); - paginator.addLine("Key: ID Name"); + paginator.addLine("Key: ID Name"); for (int i = 0; i < npcs.size(); i += 2) { - String line = "" + npcs.get(i).getId() + " " + npcs.get(i).getName(); + String line = "" + npcs.get(i).getId() + " " + npcs.get(i).getName(); if (npcs.size() >= i + 2) - line += " " + "" + npcs.get(i + 1).getId() + " " + npcs.get(i + 1).getName(); + line += " " + "" + npcs.get(i + 1).getId() + " " + npcs.get(i + 1).getName(); paginator.addLine(line); } diff --git a/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index 601988cfb..3f203737d 100644 --- a/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -345,13 +345,17 @@ public class CitizensNavigator implements Navigator, Runnable { } private void updateMountedStatus() { - if (!isNavigating()) + // TODO: this method seems to break assumptions: better to let the NPC pathfind for itself rather than + // "commanding" the NPC below on the stack + if (!isNavigating() || true) return; Entity vehicle = NMS.getVehicle(npc.getEntity()); if (!(vehicle instanceof NPCHolder)) { return; } NPC mount = ((NPCHolder) vehicle).getNPC(); + if (mount.getNavigator().isNavigating()) + return; switch (getTargetType()) { case ENTITY: mount.getNavigator().setTarget(getEntityTarget().getTarget(), getEntityTarget().isAggressive()); @@ -373,7 +377,7 @@ public class CitizensNavigator implements Navigator, Runnable { if (localParams.stationaryTicks() < 0) return false; Location current = npc.getEntity().getLocation(STATIONARY_LOCATION); - if (current.getY() < -5) { + if (current.getY() < -6) { stopNavigating(CancelReason.STUCK); return true; } diff --git a/main/src/main/java/net/citizensnpcs/npc/skin/TabListRemover.java b/main/src/main/java/net/citizensnpcs/npc/skin/TabListRemover.java index d5103457d..2f4477bcf 100644 --- a/main/src/main/java/net/citizensnpcs/npc/skin/TabListRemover.java +++ b/main/src/main/java/net/citizensnpcs/npc/skin/TabListRemover.java @@ -70,8 +70,9 @@ public class TabListRemover { skinnable.getSkinTracker().notifyRemovePacketCancelled(player.getUniqueId()); } - if (entry.toRemove.isEmpty()) + if (entry.toRemove.isEmpty()) { pending.remove(player.getUniqueId()); + } } private PlayerEntry getEntry(Player player) { diff --git a/main/src/main/java/net/citizensnpcs/trait/Controllable.java b/main/src/main/java/net/citizensnpcs/trait/Controllable.java index f6055a571..850512e13 100644 --- a/main/src/main/java/net/citizensnpcs/trait/Controllable.java +++ b/main/src/main/java/net/citizensnpcs/trait/Controllable.java @@ -195,7 +195,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab if (!enabled || !npc.isSpawned()) return; List passengers = NMS.getPassengers(npc.getEntity()); - if (passengers.size() == 0 || !(passengers.get(0) instanceof Player)) + if (passengers.size() == 0 || !(passengers.get(0) instanceof Player) || npc.getNavigator().isNavigating()) return; controller.run((Player) passengers.get(0)); } diff --git a/main/src/main/resources/messages_en.properties b/main/src/main/resources/messages_en.properties index 0f6a86ddf..deb1a516b 100644 --- a/main/src/main/resources/messages_en.properties +++ b/main/src/main/resources/messages_en.properties @@ -137,7 +137,7 @@ citizens.commands.npc.pathopt.stationary-ticks-set=[[{0}]]''s maximum stationary citizens.commands.npc.pathopt.distance-margin-set=[[{0}]]''s pathfinding distance margin set to [[{1}]]. citizens.commands.npc.pathopt.path-distance-margin-set=[[{0}]]''s pathfinding path distance margin set to [[{1}]]. citizens.commands.npc.pathopt.attack-range-set=[[{0}]]''s attack range set to [[{1}]]. -citizens.commands.npc.pathopt.use-new-finder=[[{0}]]'' use new finder set to [[{1}]]. +citizens.commands.npc.pathopt.use-new-finder=[[{0}]]''s use new finder set to [[{1}]]. citizens.commands.npc.playerlist.added=Added [[{0}]] to the player list. citizens.commands.npc.playerlist.removed=Removed [[{0}]] from the player list. citizens.commands.npc.pose.added=Pose added. @@ -307,7 +307,7 @@ citizens.editors.waypoints.guided.added-guide=Added a [[guide]] waypoint. This w citizens.editors.waypoints.guided.added-available=Added a [[destination]] waypoint. This will be available for NPCs to path to. citizens.editors.waypoints.guided.already-taken=There is already a waypoint here. citizens.editors.waypoints.linear.added-waypoint=[[Added]] a waypoint at ({0}) ([[{1}]], [[{2}]]). -citizens.editors.waypoints.linear.begin=Entered the linear waypoint editor!
[[Left click]] to add a waypoint, [[right click]] to remove.
Type [[toggle path]] to toggle showing entities at waypoints, [[triggers]] to enter the trigger editor and [[clear]] to clear all waypoints. +citizens.editors.waypoints.linear.begin=Entered the linear waypoint editor!
[[Left click]] to add a waypoint, [[right click]] to remove.
Type [[toggle path]] to toggle showing entities at waypoints,
[[triggers]] to enter the trigger editor,
[[clear]] to clear all waypoints. citizens.editors.waypoints.linear.edit-slot-set=Editing slot set to [[{0}]] ({1}). citizens.editors.waypoints.linear.end=Exited the linear waypoint editor. citizens.editors.waypoints.linear.not-showing-markers=[[Stopped]] showing waypoint markers. diff --git a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseDonkeyController.java b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseDonkeyController.java index 81904b9ef..694fdec85 100644 --- a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseDonkeyController.java +++ b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseDonkeyController.java @@ -45,9 +45,7 @@ public class HorseDonkeyController extends MobEntityController { public static class EntityHorseDonkeyNPC extends EntityHorseDonkey implements NPCHolder { private double baseMovementSpeed; - private final CitizensNPC npc; - private boolean riding; public EntityHorseDonkeyNPC(World world) { diff --git a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseSkeletonController.java b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseSkeletonController.java index 608970d1e..c8307500a 100644 --- a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseSkeletonController.java +++ b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseSkeletonController.java @@ -45,9 +45,7 @@ public class HorseSkeletonController extends MobEntityController { public static class EntityHorseSkeletonNPC extends EntityHorseSkeleton implements NPCHolder { private double baseMovementSpeed; - private final CitizensNPC npc; - private boolean riding; public EntityHorseSkeletonNPC(World world) { diff --git a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseZombieController.java b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseZombieController.java index ee6d37cd8..bfe141339 100644 --- a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseZombieController.java +++ b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/HorseZombieController.java @@ -45,9 +45,7 @@ public class HorseZombieController extends MobEntityController { public static class EntityHorseZombieNPC extends EntityHorseZombie implements NPCHolder { private double baseMovementSpeed; - private final CitizensNPC npc; - private boolean riding; public EntityHorseZombieNPC(World world) { diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java index a5e305707..1a606205c 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java @@ -233,8 +233,8 @@ public class HorseController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java index e8d5ef44d..93c3a3b4d 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java @@ -232,8 +232,8 @@ public class HorseDonkeyController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java index b4d61ceb0..9e43788fd 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java @@ -232,8 +232,8 @@ public class HorseMuleController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java index a2c81545f..5e6c369ad 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java @@ -233,8 +233,8 @@ public class HorseSkeletonController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java index 16c2c37fd..407406b84 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java @@ -233,8 +233,8 @@ public class HorseZombieController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseController.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseController.java index a43dd00d8..f2e927768 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseController.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseController.java @@ -63,7 +63,7 @@ public class HorseController extends MobEntityController { NMSImpl.clearGoals(npc, goalSelector, targetSelector); Horse horse = (Horse) getBukkitEntity(); horse.setDomestication(horse.getMaxDomestication()); - baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 0.8; + baseMovementSpeed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue(); } } @@ -236,8 +236,8 @@ public class HorseController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseDonkeyController.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseDonkeyController.java index 1925496e6..ce25e2206 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseDonkeyController.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseDonkeyController.java @@ -234,8 +234,8 @@ public class HorseDonkeyController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseMuleController.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseMuleController.java index 662f74517..86102ead4 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseMuleController.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseMuleController.java @@ -234,8 +234,8 @@ public class HorseMuleController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseSkeletonController.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseSkeletonController.java index 2ed540764..1eabf048e 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseSkeletonController.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseSkeletonController.java @@ -235,8 +235,8 @@ public class HorseSkeletonController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseZombieController.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseZombieController.java index 91505009e..c0ffa5fe6 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseZombieController.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/HorseZombieController.java @@ -235,8 +235,8 @@ public class HorseZombieController extends MobEntityController { riding = false; } if (riding) { - org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); - if (basePassenger instanceof NPCHolder) { + if (npc.getNavigator().isNavigating()) { + org.bukkit.entity.Entity basePassenger = passengers.get(0).getBukkitEntity(); NMS.look(basePassenger, yaw, pitch); } d(4, true); // datawatcher method