diff options
Diffstat (limited to 'src/main/java/com/encrox/zombie/interactable')
4 files changed, 110 insertions, 0 deletions
diff --git a/src/main/java/com/encrox/zombie/interactable/Chest.java b/src/main/java/com/encrox/zombie/interactable/Chest.java new file mode 100755 index 0000000..10045a2 --- /dev/null +++ b/src/main/java/com/encrox/zombie/interactable/Chest.java @@ -0,0 +1,27 @@ +package com.encrox.zombie.interactable;
+
+import org.bukkit.block.BlockFace;
+import org.bukkit.util.BlockVector;
+
+public class Chest extends Interactable {
+
+ private BlockFace facing;
+
+ public Chest(BlockVector bv, int cost, BlockFace facing) {
+ super(bv, cost);
+ this.facing = facing;
+ }
+
+ public Chest(BlockVector bv, int cost, String facing) {
+ this(bv, cost, BlockFace.valueOf(facing));
+ }
+
+ public Chest(BlockVector bv, int cost) {
+ this(bv, cost, BlockFace.NORTH);
+ }
+
+ public BlockFace getFacing() {
+ return facing;
+ }
+
+}
diff --git a/src/main/java/com/encrox/zombie/interactable/Interactable.java b/src/main/java/com/encrox/zombie/interactable/Interactable.java new file mode 100755 index 0000000..9bc4dc3 --- /dev/null +++ b/src/main/java/com/encrox/zombie/interactable/Interactable.java @@ -0,0 +1,23 @@ +package com.encrox.zombie.interactable;
+
+import org.bukkit.util.BlockVector;
+
+public abstract class Interactable {
+
+ private BlockVector bv;
+ private int cost;
+
+ public Interactable(BlockVector bv, int cost) {
+ this.bv = bv;
+ this.cost = cost;
+ }
+
+ public int getCost() {
+ return cost;
+ }
+
+ public BlockVector getBlockVector() {
+ return bv;
+ }
+
+}
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 diff --git a/src/main/java/com/encrox/zombie/interactable/Powerup.java b/src/main/java/com/encrox/zombie/interactable/Powerup.java new file mode 100755 index 0000000..e1ca0d2 --- /dev/null +++ b/src/main/java/com/encrox/zombie/interactable/Powerup.java @@ -0,0 +1,22 @@ +package com.encrox.zombie.interactable;
+
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.util.BlockVector;
+
+public class Powerup extends Interactable {
+
+ private ItemStack item;
+
+ public Powerup(BlockVector bv, ItemStack item, int cost) {
+ super(bv, cost);
+ this.item = item;
+ }
+
+ public ItemStack getItem() {
+ return item;
+ }
+
+}
|