Interface BlockState

All Known Implementing Classes:
BukkitBlockState

public interface BlockState
Represents a block with explicitly set states.
  • Method Details

    • getType

      @NotNull @NotNull BlockType getType()
      Get the BlockType represented by this BlockState.
      Returns:
      the block type
    • getAsString

      @NotNull @NotNull String getAsString(boolean hideUnspecified)
      Get this BlockState as a string.
      Parameters:
      hideUnspecified - whether or not to hide states that were not explicitly set in the construction of this state
      Returns:
      the string
    • matches

      boolean matches(@NotNull @NotNull BlockState state)
      Check whether or not this BlockState matches the given BlockState.

      A BlockState will match if all states that were explicitly set by this BlockState match that of the provided BlockState. Any states that were not explicitly set are ignored. Therefore, while a.matches(b) may return true, it cannot be guaranteed that b.matches(a) will also return true.

      Parameters:
      state - the state to check
      Returns:
      true if the provided BlockState matches this BlockState, false if one of its states do not match one of this BlockState's explicitly set states