Fix @Requirements

This commit is contained in:
fullwall 2012-12-10 18:59:33 +08:00
parent 121932b56e
commit 9472fb7943
4 changed files with 6 additions and 7 deletions

View File

@ -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() {

View File

@ -35,7 +35,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
public class CommandManager {
private final Map<Class<? extends Annotation>, CommandAnnotationProcessor> annotationProcessors = Maps
.newHashMap();

View File

@ -620,7 +620,7 @@ public class NPCCommands {
Messaging.send(sender, " <a>Type: <e>" + npc.getTrait(MobType.class).getType());
if (npc.isSpawned()) {
Location loc = npc.getBukkitEntity().getLocation();
String format = " <a>Spawned at: <e> %d, %d, %d in world %s";
String format = " <a>Spawned at <e>%d, %d, %d <a>in world<e> %s";
Messaging.send(sender, String.format(format, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(),
loc.getWorld().getName()));
}

View File

@ -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);
}