mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-08-20 21:03:03 +02: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));
|
velocity.setY(Math.max(velocity.getY(), 0));
|
||||||
npc.getBukkitEntity().setVelocity(velocity);
|
npc.getBukkitEntity().setVelocity(velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void gravitate(boolean gravitate) {
|
||||||
|
enabled = gravitate;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean toggle() {
|
public boolean toggle() {
|
||||||
|
|
|
@ -39,7 +39,11 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||||
realisticLooking = args.hasFlag('r');
|
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);
|
List<Entity> nearby = npc.getBukkitEntity().getNearbyEntities(range, range, range);
|
||||||
final Location npcLocation = npc.getBukkitEntity().getLocation();
|
final Location npcLocation = npc.getBukkitEntity().getLocation();
|
||||||
Collections.sort(nearby, new Comparator<Entity>() {
|
Collections.sort(nearby, new Comparator<Entity>() {
|
||||||
|
@ -114,7 +118,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||||
enabled = !enabled;
|
enabled = !enabled;
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "LookClose{" + enabled + "}";
|
return "LookClose{" + enabled + "}";
|
||||||
|
|
|
@ -53,5 +53,6 @@ public class WaypointTriggerRegistry implements Persister {
|
||||||
addTrigger("chat", ChatTrigger.class, ChatTriggerPrompt.class);
|
addTrigger("chat", ChatTrigger.class, ChatTriggerPrompt.class);
|
||||||
addTrigger("delay", DelayTrigger.class, DelayTriggerPrompt.class);
|
addTrigger("delay", DelayTrigger.class, DelayTriggerPrompt.class);
|
||||||
addTrigger("teleport", TeleportTrigger.class, TeleportTriggerPrompt.class);
|
addTrigger("teleport", TeleportTrigger.class, TeleportTriggerPrompt.class);
|
||||||
|
addTrigger("pose", PoseTrigger.class, PoseTriggerPrompt.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user