Interface BlockStateHolder<B extends BlockStateHolder<B>>

All Superinterfaces:
Pattern
All Known Implementing Classes:
BaseBlock, BlockState, FuzzyBlockState, LegacyBaseBlockWrapper, MobSpawnerBlock, SignBlock, SkullBlock

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

    • getBlockType

      BlockType getBlockType()
      Get the block type.
      Returns:
      The type
    • 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
    • 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<org.enginehub.linbus.tree.LinCompoundTag> compoundTag)
      Gets a BaseBlock from this BlockStateHolder.
      Parameters:
      compoundTag - The NBT Data to apply
      Returns:
      The BaseBlock
      API Note:
      This must be overridden by new subclasses. See NonAbstractForCompatibility for details
    • toBaseBlock

      default BaseBlock toBaseBlock(org.enginehub.linbus.tree.LinCompoundTag 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
    • getAsString

      default String getAsString()