diff --git a/src/main/java/net/citizensnpcs/Citizens.java b/src/main/java/net/citizensnpcs/Citizens.java index 9c4164ab7..3383db976 100644 --- a/src/main/java/net/citizensnpcs/Citizens.java +++ b/src/main/java/net/citizensnpcs/Citizens.java @@ -227,6 +227,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { private void registerCommands() { commands.setInjector(new Injector(this)); + commands.registerAnnotationProcessor(new RequirementsProcessor()); // Register command classes commands.register(AdminCommands.class); @@ -237,7 +238,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin { commands.register(TemplateCommands.class); commands.register(TraitCommands.class); commands.register(WaypointCommands.class); - commands.registerAnnotationProcessor(new RequirementsProcessor()); } private void registerScriptHelpers() { diff --git a/src/main/java/net/citizensnpcs/command/CommandManager.java b/src/main/java/net/citizensnpcs/command/CommandManager.java index 6fd77a8ac..079f816e4 100644 --- a/src/main/java/net/citizensnpcs/command/CommandManager.java +++ b/src/main/java/net/citizensnpcs/command/CommandManager.java @@ -35,7 +35,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; public class CommandManager { - private final Map, CommandAnnotationProcessor> annotationProcessors = Maps .newHashMap(); diff --git a/src/main/java/net/citizensnpcs/command/command/NPCCommands.java b/src/main/java/net/citizensnpcs/command/command/NPCCommands.java index ac5fc5b7c..3c949a149 100644 --- a/src/main/java/net/citizensnpcs/command/command/NPCCommands.java +++ b/src/main/java/net/citizensnpcs/command/command/NPCCommands.java @@ -620,7 +620,7 @@ public class NPCCommands { Messaging.send(sender, " Type: " + npc.getTrait(MobType.class).getType()); if (npc.isSpawned()) { Location loc = npc.getBukkitEntity().getLocation(); - String format = " Spawned at: %d, %d, %d in world %s"; + String format = " Spawned at %d, %d, %d in world %s"; Messaging.send(sender, String.format(format, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), loc.getWorld().getName())); } diff --git a/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java b/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java index 054219884..92ea6742f 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java +++ b/src/main/java/net/citizensnpcs/npc/ai/AStarNavigationStrategy.java @@ -28,8 +28,8 @@ public class AStarNavigationStrategy extends AbstractPathStrategy { this.destination = dest; this.npc = npc; Location location = npc.getBukkitEntity().getEyeLocation(); - plan = (Path) ASTAR.runFully(new VectorGoal(dest), new VectorNode(location, new ChunkBlockSource( - location, params.range()), params.examiners()), (int) (params.range() * 10)); + plan = ASTAR.runFully(new VectorGoal(dest), new VectorNode(location, new ChunkBlockSource(location, + params.range()), params.examiners()), (int) (params.range() * 10)); if (plan == null || plan.isComplete()) { setCancelReason(CancelReason.STUCK); } else { @@ -62,11 +62,11 @@ public class AStarNavigationStrategy extends AbstractPathStrategy { .playEffect(vector.toLocation(npc.getBukkitEntity().getWorld()), Effect.STEP_SOUND, org.bukkit.Material.STONE.getId()); } - NMS.setDestination(npc.getBukkitEntity(), vector.getX(), vector.getY(), vector.getZ(), params.speed()); + NMS.setDestination(npc.getBukkitEntity(), vector.getBlockX(), vector.getBlockY() + 2, + vector.getBlockZ(), params.speed()); return false; } private static final AStarMachine ASTAR = AStarMachine.createWithDefaultStorage(); - private static final Location NPC_LOCATION = new Location(null, 0, 0, 0); } \ No newline at end of file