mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Fix @Requirements
This commit is contained in:
parent
891e2fa96d
commit
6d6dec8e7a
@ -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() {
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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()));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user