Class MaterialData

java.lang.Object
org.bukkit.material.MaterialData
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Banner, Bed, Cake, Cauldron, Coal, CocoaPlant, Command, Comparator, Crops, Diode, DirectionalContainer, Door, Dye, FlowerPot, Gate, Hopper, LongGrass, Mushroom, NetherWarts, Observer, PistonBaseMaterial, PistonExtensionMaterial, PressurePlate, Pumpkin, Rails, RedstoneWire, Sandstone, Sign, SimpleAttachableMaterialData, Skull, SpawnEgg, Stairs, TexturedMaterial, Tripwire, Vine, Wood, Wool

@Deprecated(since="1.13", forRemoval=true) public class MaterialData extends Object implements Cloneable
Deprecated, for removal: This API element is subject to removal in a future version.
all usage of MaterialData is deprecated and subject to removal. Use BlockData.
Handles specific metadata for certain items or blocks
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    MaterialData(Material type, byte data)
    Deprecated.
    Magic value
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    byte
    Deprecated.
    Magic value
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the Material that this MaterialData represents
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setData(byte data)
    Deprecated.
    Magic value
    Deprecated.
    this method creates an ItemStack of size 0 which is not generally useful.
    toItemStack(int amount)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new ItemStack based on this MaterialData
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MaterialData

      public MaterialData(Material type)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • MaterialData

      @Deprecated(since="1.6.2") public MaterialData(Material type, byte data)
      Deprecated.
      Magic value
      Parameters:
      type - the type
      data - the raw data value
  • Method Details

    • getData

      @Deprecated(since="1.6.2") public byte getData()
      Deprecated.
      Magic value
      Gets the raw data in this material
      Returns:
      Raw data
    • setData

      @Deprecated(since="1.6.2") public void setData(byte data)
      Deprecated.
      Magic value
      Sets the raw data of this material
      Parameters:
      data - New raw data
    • getItemType

      public Material getItemType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the Material that this MaterialData represents
      Returns:
      Material represented by this MaterialData
    • toItemStack

      @Deprecated(since="1.12") public ItemStack toItemStack()
      Deprecated.
      this method creates an ItemStack of size 0 which is not generally useful. Consider toItemStack(int).
      Creates a new ItemStack based on this MaterialData
      Returns:
      New ItemStack containing a copy of this MaterialData
    • toItemStack

      public ItemStack toItemStack(int amount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
    • clone

      public MaterialData clone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      clone in class Object