Class BlockType

java.lang.Object
com.sk89q.worldedit.world.block.BlockType
All Implemented Interfaces:
Keyed

public class BlockType extends Object implements Keyed
  • Field Details

  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Gets the ID of this block.
      Specified by:
      getId in interface Keyed
      Returns:
      The id
    • getRichName

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

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

      public Map<String,? extends Property<?>> getPropertyMap()
      Gets the properties of this BlockType in a key->property mapping.
      Returns:
      The properties map
    • getProperties

      public List<? extends Property<?>> getProperties()
      Gets the properties of this BlockType.
      Returns:
      the properties
    • getProperty

      public <V> Property<V> getProperty(String name)
      Gets a property by name.
      Parameters:
      name - The name
      Returns:
      The property
    • getDefaultState

      public BlockState getDefaultState()
      Gets the default state of this block type.
      Returns:
      The default state
    • getFuzzyMatcher

      public FuzzyBlockState getFuzzyMatcher()
    • getAllStates

      public List<BlockState> getAllStates()
      Gets a list of all possible states for this BlockType.
      Returns:
      All possible states
    • getState

      public BlockState getState(Map<Property<?>,Object> key)
      Gets a state of this BlockType with the given properties.
      Returns:
      The state, if it exists
    • hasItemType

      public boolean hasItemType()
      Gets whether this block type has an item representation.
      Returns:
      If it has an item
    • getItemType

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

      public BlockMaterial getMaterial()
      Get the material for this BlockType.
      Returns:
      The material
    • getLegacyId

      @Deprecated public int getLegacyId()
      Deprecated.
      Gets the legacy ID. Needed for legacy reasons.

      DO NOT USE THIS.

      Returns:
      legacy id or 0, if unknown
    • getLegacyData

      @Deprecated public int getLegacyData()
      Deprecated.
      Gets the legacy data. Needed for legacy reasons.

      DO NOT USE THIS.

      Returns:
      legacy data or 0, if unknown
    • 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