Interface BlockStateHolder<B extends BlockStateHolder<B>>

All Superinterfaces:
Filter, NbtValued, Pattern, TileEntityBlock
All Known Implementing Classes:
BaseBlock, BlanketBaseBlock, BlockState, FuzzyBlockState, MobSpawnerBlock, SignBlock, SkullBlock

public interface BlockStateHolder<B extends BlockStateHolder<B>> extends TileEntityBlock, Pattern
  • Method Details

    • getBlockType

      BlockType getBlockType()
      Get the block type.
      Returns:
      The type
    • withPropertyId

      @Deprecated B withPropertyId(int propertyId)
      Deprecated.
      Magic number (legacy uses).
    • getInternalId

      @Deprecated int getInternalId()
      Deprecated.
      Get combined id (legacy uses).
    • getOrdinal

      @Deprecated int getOrdinal()
      Deprecated.
    • getOrdinalChar

      @Deprecated char getOrdinalChar()
      Deprecated.
    • getMaterial

      BlockMaterial getMaterial()
    • getInternalBlockTypeId

      @Deprecated int getInternalBlockTypeId()
      Deprecated.
      Get type id (legacy uses).
    • getInternalPropertiesId

      @Deprecated int getInternalPropertiesId()
      Deprecated.
      Get the block data (legacy uses).
    • with

      <V> B with(Property<V> property, V value)
      Returns a BlockState with the given state and value applied.
      Parameters:
      property - The state
      value - The value
      Returns:
      The modified state, or same if could not be applied
    • getState

      <V> V getState(Property<V> property)
      Gets the value for the given state.
      Parameters:
      property - The state
      Returns:
      The value
    • with

      <V> B with(PropertyKey property, V value)
      Returns a BlockStateHolder with the given state and value applied.
      Parameters:
      property - The property key
      value - The value
      Returns:
      The modified state, or same if could not be applied
    • getState

      <V> V getState(PropertyKey property)
      Gets the value for the given state.
      Parameters:
      property - The state
      Returns:
      The value
    • getStates

      Map<Property<?>,Object> getStates()
      Gets an immutable collection of the states.
      Returns:
      The states
    • equalsFuzzy

      boolean equalsFuzzy(BlockStateHolder<?> o)
      Checks if the type is the same, and if the matched states are the same.
      Parameters:
      o - other block
      Returns:
      true if equal
    • toImmutableState

      BlockState toImmutableState()
      Returns an immutable BlockState from this BlockStateHolder.
      Returns:
      A BlockState
    • toBaseBlock

      BaseBlock toBaseBlock()
      Gets a BaseBlock from this BlockStateHolder.
      Returns:
      The BaseBlock
    • toBaseBlock

      @Deprecated default BaseBlock toBaseBlock(CompoundTag compoundTag)
      Deprecated.
      Gets a BaseBlock from this BlockStateHolder.
      Parameters:
      compoundTag - The NBT Data to apply
      Returns:
      The BaseBlock
    • toBaseBlock

      @NonAbstractForCompatibility(delegateName="toBaseBlock", delegateParams=CompoundTag.class) default BaseBlock toBaseBlock(LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> compoundTag)
      Gets a BaseBlock from this BlockStateHolder.
      Parameters:
      compoundTag - The NBT Data to apply
      Returns:
      The BaseBlock This must be overridden by new subclasses. See NonAbstractForCompatibility for details
    • toBaseBlock

      default BaseBlock toBaseBlock(com.sk89q.worldedit.util.nbt.CompoundBinaryTag compoundTag)
      Gets a BaseBlock from this BlockStateHolder.
      Parameters:
      compoundTag - The NBT Data to apply
      Returns:
      The BaseBlock
    • applyBlock

      default 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
    • applyTileEntity

      void applyTileEntity(OutputExtent output, int x, int y, int z)
    • toBaseBlock

      default BaseBlock toBaseBlock(ITileInput input, int x, int y, int z)
    • getAsString

      default String getAsString()