mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-12 07:38:11 +02:00
Add a few methods for setting lookclose/gravity directly.
This commit is contained in:
parent
3faa57ee70
commit
0021b57f44
@ -22,6 +22,10 @@ public class Gravity extends Trait implements Toggleable {
|
|||||||
npc.getBukkitEntity().setVelocity(velocity);
|
npc.getBukkitEntity().setVelocity(velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void gravitate(boolean gravitate) {
|
||||||
|
enabled = gravitate;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean toggle() {
|
public boolean toggle() {
|
||||||
return enabled = !enabled;
|
return enabled = !enabled;
|
||||||
|
@ -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>() {
|
||||||
|
@ -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