Package wtf.choco.veinminer.block
Class VeinMinerBlockState
java.lang.Object
wtf.choco.veinminer.block.VeinMinerBlockState
- All Implemented Interfaces:
Comparable<VeinMinerBlock>
,VeinMinerBlock
A type of
VeinMinerBlock
backed by a BlockState
.-
Field Summary
Fields inherited from interface wtf.choco.veinminer.block.VeinMinerBlock
WILDCARD
-
Constructor Summary
ConstructorDescriptionVeinMinerBlockState
(@NotNull BlockState state) Construct a newVeinMinerBlockState
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull BlockState
getState()
Get theBlockState
represented by this block.@NotNull BlockType
getType()
Get theBlockType
represented by this block.int
hashCode()
boolean
hasState()
Check whether or not this block has at least one state set.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.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface wtf.choco.veinminer.block.VeinMinerBlock
compareTo, matchesState
-
Constructor Details
-
VeinMinerBlockState
Construct a newVeinMinerBlockState
.- Parameters:
state
- the state
-
-
Method Details
-
getType
Description copied from interface:VeinMinerBlock
Get theBlockType
represented by this block.- Specified by:
getType
in interfaceVeinMinerBlock
- Returns:
- the type
-
getState
Description copied from interface:VeinMinerBlock
Get theBlockState
represented by this block.If this block has no state (e.g.
VeinMinerBlock.hasState()
isfalse
), this method should return a state with default block state values.- Specified by:
getState
in interfaceVeinMinerBlock
- Returns:
- the state
-
hasState
public boolean hasState()Description copied from interface:VeinMinerBlock
Check whether or not this block has at least one state set.- Specified by:
hasState
in interfaceVeinMinerBlock
- Returns:
- true if a state is set, false otherwise
-
matchesType
Description copied from interface:VeinMinerBlock
Check whether or not thisVeinMinerBlock
matches the givenBlockType
.- Specified by:
matchesType
in interfaceVeinMinerBlock
- Parameters:
type
- the type to check- Returns:
- true if this block matches the given type, false otherwise
-
matchesState
Description copied from interface:VeinMinerBlock
Check whether or not thisVeinMinerBlock
matches the givenBlockState
.- Specified by:
matchesState
in interfaceVeinMinerBlock
- Parameters:
state
- the state to checkexact
- whether or not to match against all states- Returns:
- true if matches, false otherwise
-
toStateString
Description copied from interface:VeinMinerBlock
Get thisVeinMinerBlock
as a state string.- Specified by:
toStateString
in interfaceVeinMinerBlock
- Returns:
- the state string
-
hashCode
public int hashCode() -
equals
-
toString
-