Ton of Material extensions handling the meta-data of blocks.

By: sunkid <sunkid@iminurnetz.com>
This commit is contained in:
Bukkit/Spigot
2011-04-02 16:42:12 -07:00
parent a449fb01d1
commit 84a31c3951
31 changed files with 1203 additions and 135 deletions

View File

@@ -1,15 +1,28 @@
package org.bukkit.material;
import java.util.HashSet;
import org.bukkit.Material;
public class Jukebox extends MaterialData {
private static HashSet<Material> recordTypes = new HashSet<Material>();
static {
recordTypes.add(Material.GOLD_RECORD);
recordTypes.add(Material.GREEN_RECORD);
}
public Jukebox() {
super(Material.JUKEBOX);
}
public Jukebox(int type) {
super(type);
}
public Jukebox(Material type) {
super(type);
super((recordTypes.contains(type)) ? Material.JUKEBOX : type);
if(recordTypes.contains(type))
setPlaying(type);
}
public Jukebox(int type, byte data) {
@@ -55,4 +68,10 @@ public class Jukebox extends MaterialData {
setData((byte) 0x0);
}
}
@Override
public String toString() {
return super.toString() + " playing " + getPlaying();
}
}