From 3ceb5d884eb8baeab5e1c2b9d7b345e8296792f1 Mon Sep 17 00:00:00 2001 From: Jeremy Schroeder Date: Sun, 3 Mar 2013 00:42:20 -0500 Subject: [PATCH] Add setRange(...) and setRealisticLooking(...) to LookClose. Add getPose(...) to Pose. --- Citizens2.iml | 17 +++++++++++++++++ .../java/net/citizensnpcs/trait/LookClose.java | 8 ++++++++ src/main/java/net/citizensnpcs/trait/Poses.java | 9 +++++++++ 3 files changed, 34 insertions(+) create mode 100644 Citizens2.iml diff --git a/Citizens2.iml b/Citizens2.iml new file mode 100644 index 000000000..fc5130665 --- /dev/null +++ b/Citizens2.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/main/java/net/citizensnpcs/trait/LookClose.java b/src/main/java/net/citizensnpcs/trait/LookClose.java index 25613eae7..0e13ec881 100644 --- a/src/main/java/net/citizensnpcs/trait/LookClose.java +++ b/src/main/java/net/citizensnpcs/trait/LookClose.java @@ -114,6 +114,14 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable key.setBoolean("realisticlooking", realisticLooking); } + public void setRange(int range) { + this.range = range; + } + + public void setRealisticLooking(boolean realistic) { + this.realisticLooking = realistic; + } + @Override public boolean toggle() { enabled = !enabled; diff --git a/src/main/java/net/citizensnpcs/trait/Poses.java b/src/main/java/net/citizensnpcs/trait/Poses.java index 467743037..a9a994fbd 100644 --- a/src/main/java/net/citizensnpcs/trait/Poses.java +++ b/src/main/java/net/citizensnpcs/trait/Poses.java @@ -63,6 +63,15 @@ public class Poses extends Trait { throw new CommandException(Messages.COMMAND_PAGE_MISSING); } + + public Pose getAnchor(String name) { + for (Pose pose : poses.values()) + if (pose.getName().equalsIgnoreCase(name)) + return pose; + return null; + } + + public boolean hasPose(String pose) { return poses.containsKey(pose.toLowerCase()); }