diff options
Diffstat (limited to 'src/main/java/com/encrox/zombie/interactable/Lever.java')
-rwxr-xr-x | src/main/java/com/encrox/zombie/interactable/Lever.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/com/encrox/zombie/interactable/Lever.java b/src/main/java/com/encrox/zombie/interactable/Lever.java new file mode 100755 index 0000000..4776f39 --- /dev/null +++ b/src/main/java/com/encrox/zombie/interactable/Lever.java @@ -0,0 +1,38 @@ +package com.encrox.zombie.interactable;
+
+import org.bukkit.util.BlockVector;
+
+public class Lever extends Interactable {
+
+ private boolean toggle;
+ private Lever[] others;
+
+ public Lever(BlockVector bv, int cost, boolean toggle, Lever[] others) {
+ super(bv, cost);
+ this.toggle = toggle;
+ this.others = others;
+ }
+
+ public Lever(BlockVector bv, int cost, Lever[] others) {
+ this(bv, cost, false, others);
+ }
+
+ public Lever(BlockVector bv, int cost, boolean toggle) {
+ this(bv, cost, toggle, new Lever[0]);
+ }
+
+ public Lever(BlockVector bv, int cost) {
+ this(bv, cost, false);
+ }
+
+ public void toggle() {
+ toggle = !toggle;
+ for(int i = 0; i<others.length; i++)
+ others[i].toggle();
+ }
+
+ public boolean isToggled() {
+ return toggle;
+ }
+
+}
\ No newline at end of file |