Class BlockType

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

public class BlockType extends Object implements Keyed, Pattern
  • Field Details

  • Constructor Details

  • Method Details

    • getMaxStateId

      @Deprecated public int getMaxStateId()
      Deprecated.
    • 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()
    • getNamespace

      public String getNamespace()
    • getResource

      public String getResource()
    • 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
    • withPropertyId

      @Deprecated public BlockState withPropertyId(int propertyId)
      Deprecated.
    • withStateId

      @Deprecated public BlockState withStateId(int internalStateId)
      Deprecated.
    • 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
    • getPropertiesSet

      @Deprecated public Set<? extends Property<?>> getPropertiesSet()
      Deprecated.
    • getProperty

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

      public boolean hasProperty(PropertyKey key)
    • getProperty

      public <V> Property<V> getProperty(PropertyKey key)
    • 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

      @Deprecated(forRemoval=true) public BlockState getState(Map<Property<?>,Object> key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not working. Not necessarily for removal, but WARNING DO NOT USE FOR NOW
      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
    • getLegacyCombinedId

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

      DO NOT USE THIS.

      Returns:
      legacy id or 0, if unknown
    • getLegacyId

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

      DO NOT USE THIS.

      Returns:
      legacy data 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
    • getInternalId

      public int getInternalId()
      The internal index of this type.

      This number is not necessarily consistent across restarts.

      Returns:
      internal id
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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

      public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException
      Specified by:
      apply in interface Pattern
      Throws:
      WorldEditException
    • applyBlock

      public BaseBlock applyBlock(BlockVector3 position)
      Description copied from interface: Pattern
      Return a BaseBlock for the given position.
      Specified by:
      applyBlock in interface Pattern
      Parameters:
      position - the position
      Returns:
      a block
    • toMask

      public SingleBlockTypeMask toMask()
    • toMask

      public SingleBlockTypeMask toMask(Extent extent)