Add a few methods for setting lookclose/gravity directly.

This commit is contained in:
Jeremy Schroeder 2012-11-07 22:23:02 -05:00
parent 3faa57ee70
commit 0021b57f44
3 changed files with 11 additions and 2 deletions

View File

@ -22,6 +22,10 @@ public class Gravity extends Trait implements Toggleable {
npc.getBukkitEntity().setVelocity(velocity);
}
public void gravitate(boolean gravitate) {
enabled = gravitate;
}
@Override
public boolean toggle() {
return enabled = !enabled;

View File

@ -39,6 +39,10 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
realisticLooking = args.hasFlag('r');
}
public void lookClose(boolean lookClose) {
enabled = lookClose;
}
private void findNewTarget() {
List<Entity> nearby = npc.getBukkitEntity().getNearbyEntities(range, range, range);
final Location npcLocation = npc.getBukkitEntity().getLocation();

View File

@ -53,5 +53,6 @@ public class WaypointTriggerRegistry implements Persister {
addTrigger("chat", ChatTrigger.class, ChatTriggerPrompt.class);
addTrigger("delay", DelayTrigger.class, DelayTriggerPrompt.class);
addTrigger("teleport", TeleportTrigger.class, TeleportTriggerPrompt.class);
addTrigger("pose", PoseTrigger.class, PoseTriggerPrompt.class);
}
}