Package org.bukkit.material
Class MaterialData
java.lang.Object
org.bukkit.material.MaterialData
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
Banner,Bed,Cake,Cauldron,Coal,CocoaPlant,Command,Crops,Diode,DirectionalContainer,Door,Dye,FlowerPot,Gate,Leaves,LongGrass,Mushroom,NetherWarts,PistonBaseMaterial,PistonExtensionMaterial,PressurePlate,Pumpkin,Rails,RedstoneWire,Sandstone,Sign,SimpleAttachableMaterialData,Skull,SpawnEgg,Stairs,TexturedMaterial,Tree,Tripwire,Vine,WoodenStep,Wool
public class MaterialData
extends java.lang.Object
implements java.lang.Cloneable
Handles specific metadata for certain items or blocks
-
Constructor Summary
Constructors Constructor Description MaterialData(int type)Deprecated.Magic valueMaterialData(int type, byte data)Deprecated.Magic valueMaterialData(Material type)MaterialData(Material type, byte data)Deprecated.Magic value -
Method Summary
Modifier and Type Method Description MaterialDataclone()booleanequals(java.lang.Object obj)bytegetData()Deprecated.Magic valueMaterialgetItemType()Gets the Material that this MaterialData representsintgetItemTypeId()Deprecated.Magic valueinthashCode()voidsetData(byte data)Deprecated.Magic valueItemStacktoItemStack()Creates a new ItemStack based on this MaterialDataItemStacktoItemStack(int amount)Creates a new ItemStack based on this MaterialDatajava.lang.StringtoString()
-
Constructor Details
-
MaterialData
@Deprecated public MaterialData(int type)Deprecated.Magic value- Parameters:
type- the raw type id
-
MaterialData
-
MaterialData
@Deprecated public MaterialData(int type, byte data)Deprecated.Magic value- Parameters:
type- the raw type iddata- the raw data value
-
MaterialData
Deprecated.Magic value- Parameters:
type- the typedata- the raw data value
-
-
Method Details
-
getData
@Deprecated public byte getData()Deprecated.Magic valueGets the raw data in this material- Returns:
- Raw data
-
setData
@Deprecated public void setData(byte data)Deprecated.Magic valueSets the raw data of this material- Parameters:
data- New raw data
-
getItemType
Gets the Material that this MaterialData represents- Returns:
- Material represented by this MaterialData
-
getItemTypeId
@Deprecated public int getItemTypeId()Deprecated.Magic valueGets the Material Id that this MaterialData represents- Returns:
- Material Id represented by this MaterialData
-
toItemStack
Creates a new ItemStack based on this MaterialData- Returns:
- New ItemStack containing a copy of this MaterialData
-
toItemStack
Creates a new ItemStack based on this MaterialData- Parameters:
amount- The stack size of the new stack- Returns:
- New ItemStack containing a copy of this MaterialData
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
clone
- Overrides:
clonein classjava.lang.Object
-