Interface BlockState

    • Method Detail

      • fromString

        static BlockState fromString​(java.lang.String id)
      • type

        BlockType type()
        Gets the base type of block.

        The type does not include block data such as the contents of inventories.

        Returns:
        The type of block
      • fluidState

        FluidState fluidState()
        Gets the associated FluidState for this block state. Depending on whether this block state is considered "waterlogged" or not, and with which fluid.
        Returns:
        The fluid state
      • rotate

        BlockState rotate​(Rotation rotation)
        Gets the appropriate BlockState for the desired Rotation. It may return the same state, but some states may have extra logic associated with rotating on its axis, much like mirroring.
        Parameters:
        rotation - The rotation
        Returns:
        The rotated state if not this state
      • rotate

        default BlockState rotate​(java.util.function.Supplier<? extends Rotation> rotation)
        Gets the appropriate BlockState for the desired Rotation. It may return the same state, but some states may have extra logic associated with rotating on its axis, much like mirroring.
        Parameters:
        rotation - The rotation
        Returns:
        The rotated state if not this state
      • mirror

        BlockState mirror​(Mirror mirror)
        Gets the appropriate BlockState for the desired Mirror. It may return the same state, but some states may have extra logic associated with mirroring on its axis, much like rotation.
        Parameters:
        mirror - The mirror
        Returns:
        The mirrored state if not this state
      • mirror

        default BlockState mirror​(java.util.function.Supplier<? extends Mirror> mirror)
        Gets the appropriate BlockState for the desired Mirror. It may return the same state, but some states may have extra logic associated with mirroring on its axis, much like rotation.
        Parameters:
        mirror - The mirror
        Returns:
        The mirrored state if not this state
      • asString

        java.lang.String asString()
        Gets a string representation of this block state, including the block type and the properties. Do not confuse with State.toString() which is implementation specific.
        Returns:
        A string representation of this block state.