diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-25 15:27:16 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-25 15:27:16 +0100 |
commit | 80b7d27d238140cc21ad547719c34935b16ba8c4 (patch) | |
tree | d55e18fa3cd45aa6f8e61458f4adb41bf8363884 /src/main/java/org | |
parent | 1002e546a4605c6fee9a30ac4265c3b4367421ce (diff) | |
download | bukkit-80b7d27d238140cc21ad547719c34935b16ba8c4.tar bukkit-80b7d27d238140cc21ad547719c34935b16ba8c4.tar.gz bukkit-80b7d27d238140cc21ad547719c34935b16ba8c4.tar.lz bukkit-80b7d27d238140cc21ad547719c34935b16ba8c4.tar.xz bukkit-80b7d27d238140cc21ad547719c34935b16ba8c4.zip |
Added MonsterEggs materialdata
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/Material.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/material/MonsterEggs.java | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 32290de9..303388e5 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -109,7 +109,7 @@ public enum Material { DIODE_BLOCK_ON(94, Diode.class), LOCKED_CHEST(95), TRAP_DOOR(96, TrapDoor.class), - MONSTER_EGGS(97), + MONSTER_EGGS(97, MonsterEggs.class), SMOOTH_BRICK(98, SmoothBrick.class), HUGE_MUSHROOM_1(99), HUGE_MUSHROOM_2(100), diff --git a/src/main/java/org/bukkit/material/MonsterEggs.java b/src/main/java/org/bukkit/material/MonsterEggs.java new file mode 100644 index 00000000..a34a9607 --- /dev/null +++ b/src/main/java/org/bukkit/material/MonsterEggs.java @@ -0,0 +1,47 @@ +package org.bukkit.material; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Material; + +/** + * Represents the different types of monster eggs + */ +public class MonsterEggs extends TexturedMaterial { + + private static final List<Material> textures = new ArrayList<Material>(); + static { + textures.add(Material.STONE); + textures.add(Material.COBBLESTONE); + textures.add(Material.SMOOTH_BRICK); + } + + public MonsterEggs() { + super(Material.SMOOTH_BRICK); + } + + public MonsterEggs(final int type) { + super(type); + } + + public MonsterEggs(final Material type) { + super((textures.contains(type)) ? Material.MONSTER_EGGS : type); + if (textures.contains(type)) { + setMaterial(type); + } + } + + public MonsterEggs(final int type, final byte data) { + super(type, data); + } + + public MonsterEggs(final Material type, final byte data) { + super(type, data); + } + + @Override + public List<Material> getTextures() { + return textures; + } +} |