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)
          Deprecated. Magic value
MaterialData(int type, byte data)
          Deprecated. Magic value
MaterialData(Material type)
           
MaterialData(Material type, byte data)
          Deprecated. Magic value
 
Method Summary
 MaterialData clone()
           
 boolean equals(Object obj)
           
 byte getData()
          Deprecated. Magic value
 Material getItemType()
          Gets the Material that this MaterialData represents
 int getItemTypeId()
          Deprecated. Magic value
 int hashCode()
           
 void setData(byte data)
          Deprecated. Magic value
 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

@Deprecated
public MaterialData(int type)
Deprecated. Magic value


MaterialData

public MaterialData(Material type)

MaterialData

@Deprecated
public MaterialData(int type,
                               byte data)
Deprecated. Magic value


MaterialData

@Deprecated
public MaterialData(Material type,
                               byte data)
Deprecated. Magic value

Method Detail

getData

@Deprecated
public byte getData()
Deprecated. Magic value

Gets the raw data in this material

Returns:
Raw data

setData

@Deprecated
public void setData(byte data)
Deprecated. Magic value

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

@Deprecated
public int getItemTypeId()
Deprecated. Magic value

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.