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 MaterialData
clone()
boolean
equals(java.lang.Object obj)
byte
getData()
Deprecated.Magic valueMaterial
getItemType()
Gets the Material that this MaterialData representsint
getItemTypeId()
Deprecated.Magic valueint
hashCode()
void
setData(byte data)
Deprecated.Magic valueItemStack
toItemStack()
Creates a new ItemStack based on this MaterialDataItemStack
toItemStack(int amount)
Creates a new ItemStack based on this MaterialDatajava.lang.String
toString()
-
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:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
clone
- Overrides:
clone
in classjava.lang.Object
-