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

This commit is contained in:
sunkid
2011-04-02 16:42:12 -07:00
committed by Erik Broes
parent 89f7386e87
commit 55e4fbfd14
31 changed files with 1203 additions and 135 deletions

View File

@@ -70,6 +70,20 @@ public class MaterialData {
* @return New ItemStack containing a copy of this MaterialData
*/
public ItemStack toItemStack() {
return new ItemStack(type);
return new ItemStack(type, 0, data);
}
/**
* Creates a new ItemStack based on this MaterialData
*
* @return New ItemStack containing a copy of this MaterialData
*/
public ItemStack toItemStack(int amount) {
return new ItemStack(type, amount, data);
}
@Override
public String toString() {
return getItemType() + "(" + getData() + ")";
}
}