mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Add a few methods for setting lookclose/gravity directly.
This commit is contained in:
parent
3faa57ee70
commit
0021b57f44
@ -21,6 +21,10 @@ public class Gravity extends Trait implements Toggleable {
|
||||
velocity.setY(Math.max(velocity.getY(), 0));
|
||||
npc.getBukkitEntity().setVelocity(velocity);
|
||||
}
|
||||
|
||||
public void gravitate(boolean gravitate) {
|
||||
enabled = gravitate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean toggle() {
|
||||
|
@ -39,7 +39,11 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
realisticLooking = args.hasFlag('r');
|
||||
}
|
||||
|
||||
private void findNewTarget() {
|
||||
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();
|
||||
Collections.sort(nearby, new Comparator<Entity>() {
|
||||
@ -114,7 +118,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
enabled = !enabled;
|
||||
return enabled;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LookClose{" + enabled + "}";
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user