Class ItemType

java.lang.Object
com.sk89q.worldedit.world.item.ItemType
All Implemented Interfaces:
Keyed

public class ItemType extends Object implements Keyed
  • Field Details

  • Constructor Details

    • ItemType

      public ItemType(String id)
  • Method Details

    • getId

      public String getId()
      Description copied from interface: Keyed
      The id of this object in the registry. Must be unique, and lowercase. Certain registries (e.g Namespaced ones) may have additional restrictions.
      Specified by:
      getId in interface Keyed
      Returns:
      an id
    • getRichName

      public com.sk89q.worldedit.util.formatting.text.Component getRichName()
    • getName

      @Deprecated public String getName()
      Deprecated.
      Names are translatable now, use getRichName().
      Gets the name of this item, or the ID if the name cannot be found.
      Returns:
      The name, or ID
    • hasBlockType

      public boolean hasBlockType()
      Gets whether this item type has a block representation.
      Returns:
      If it has a block
    • getBlockType

      @Nullable public BlockType getBlockType()
      Gets the block representation of this item type, if it exists.
      Returns:
      The block representation
    • getMaterial

      public ItemMaterial getMaterial()
      Get the material for this ItemType.
      Returns:
      The material
    • 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