Interface BlockState
- All Known Implementing Classes:
BukkitBlockState
public interface BlockState
Represents a block with explicitly set states.
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
getAsString
(boolean hideUnspecified) Get thisBlockState
as a string.@NotNull BlockType
getType()
Get theBlockType
represented by thisBlockState
.boolean
matches
(@NotNull BlockState state) Check whether or not thisBlockState
matches the given BlockState.
-
Method Details
-
getType
Get theBlockType
represented by thisBlockState
.- Returns:
- the block type
-
getAsString
Get thisBlockState
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
Check whether or not thisBlockState
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 returntrue
, it cannot be guaranteed thatb.matches(a)
will also returntrue
.- 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
-