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,5 +1,7 @@
package org.bukkit.material;
import java.util.HashSet;
import org.bukkit.Material;
/**
@@ -7,12 +9,26 @@ import org.bukkit.Material;
* @author sunkid
*/
public class Step extends MaterialData {
private static HashSet<Material> stepTypes = new HashSet<Material>();
static {
stepTypes.add(Material.SANDSTONE);
stepTypes.add(Material.WOOD);
stepTypes.add(Material.COBBLESTONE);
stepTypes.add(Material.STONE);
}
public Step() {
super(Material.STEP);
}
public Step(final int type) {
super(type);
}
public Step(final Material type) {
super(type);
super((stepTypes.contains(type)) ? Material.STEP : type);
if(stepTypes.contains(type))
setMaterial(type);
}
public Step(final int type, final byte data) {
@@ -63,4 +79,9 @@ public class Step extends MaterialData {
setData((byte) 0x0);
}
}
@Override
public String toString() {
return getMaterial() + " " + super.toString();
}
}