org.bukkit.material
Class MaterialData

java.lang.Object
  extended by org.bukkit.material.MaterialData
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
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 Object
implements Cloneable

Handles specific metadata for certain items or blocks


Constructor Summary
MaterialData(int type)
           
MaterialData(int type, byte data)
           
MaterialData(Material type)
           
MaterialData(Material type, byte data)
           
 
Method Summary
 MaterialData clone()
           
 boolean equals(Object obj)
           
 byte getData()
          Gets the raw data in this material
 Material getItemType()
          Gets the Material that this MaterialData represents
 int getItemTypeId()
          Gets the Material Id that this MaterialData represents
 int hashCode()
           
 void setData(byte data)
          Sets the raw data of this material
 ItemStack toItemStack()
          Creates a new ItemStack based on this MaterialData
 ItemStack toItemStack(int amount)
          Creates a new ItemStack based on this MaterialData
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaterialData

public MaterialData(int type)

MaterialData

public MaterialData(Material type)

MaterialData

public MaterialData(int type,
                    byte data)

MaterialData

public MaterialData(Material type,
                    byte data)
Method Detail

getData

public byte getData()
Gets the raw data in this material

Returns:
Raw data

setData

public void setData(byte data)
Sets the raw data of this material

Parameters:
data - New raw data

getItemType

public Material getItemType()
Gets the Material that this MaterialData represents

Returns:
Material represented by this MaterialData

getItemTypeId

public int getItemTypeId()
Gets the Material Id that this MaterialData represents

Returns:
Material Id represented by this MaterialData

toItemStack

public ItemStack toItemStack()
Creates a new ItemStack based on this MaterialData

Returns:
New ItemStack containing a copy of this MaterialData

toItemStack

public ItemStack toItemStack(int amount)
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 String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

clone

public MaterialData clone()
Overrides:
clone in class Object


Copyright © 2013. All Rights Reserved.