Package wtf.choco.veinminer.block
Interface VeinMinerBlock
- All Superinterfaces:
Comparable<VeinMinerBlock>
- All Known Implementing Classes:
VeinMinerBlockState
,VeinMinerBlockType
,VeinMinerBlockWildcard
Represents a block understood by vein miner.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
compareTo
(@Nullable VeinMinerBlock other) static @Nullable VeinMinerBlock
fromString
(@NotNull String string) Get aVeinMinerBlock
from a string.@NotNull BlockState
getState()
Get theBlockState
represented by this block.@NotNull BlockType
getType()
Get theBlockType
represented by this block.boolean
hasState()
Check whether or not this block has at least one state set.default boolean
matchesState
(@NotNull BlockState state) Check whether or not thisVeinMinerBlock
matches the given state.boolean
matchesState
(@NotNull BlockState state, boolean exact) Check whether or not thisVeinMinerBlock
matches the givenBlockState
.boolean
matchesType
(@NotNull BlockType type) Check whether or not thisVeinMinerBlock
matches the givenBlockType
.@NotNull String
Get thisVeinMinerBlock
as a state string.
-
Field Details
-
WILDCARD
The wildcard block.- See Also:
-
-
Method Details
-
getType
Get theBlockType
represented by this block.- Returns:
- the type
-
getState
Get theBlockState
represented by this block.If this block has no state (e.g.
hasState()
isfalse
), this method should return a state with default block state values.- Returns:
- the state
-
hasState
boolean hasState()Check whether or not this block has at least one state set.- Returns:
- true if a state is set, false otherwise
-
matchesType
Check whether or not thisVeinMinerBlock
matches the givenBlockType
.- Parameters:
type
- the type to check- Returns:
- true if this block matches the given type, false otherwise
-
matchesState
Check whether or not thisVeinMinerBlock
matches the givenBlockState
.- Parameters:
state
- the state to checkexact
- whether or not to match against all states- Returns:
- true if matches, false otherwise
-
matchesState
Check whether or not thisVeinMinerBlock
matches the given state.The provided state will match if the states explicitly declared by this block match. Any states not explicitly set by this block will be ignored.
- Parameters:
state
- the state to check- Returns:
- true if matches, false otherwise
-
toStateString
Get thisVeinMinerBlock
as a state string.- Returns:
- the state string
-
compareTo
- Specified by:
compareTo
in interfaceComparable<VeinMinerBlock>
-
fromString
Get aVeinMinerBlock
from a string. Example states:chest minecraft:chest minecraft:chest[waterlogged=true] minecraft:chest[facing=north,waterlogged=true] * // The wildcard state
- Parameters:
string
- the string from which to parse a VeinMinerBlock instance- Returns:
- the constructed VeinMinerBlock, or null if an invalid format was provided
-