public static final class BlockState.MatcherBuilder extends Object implements ResettableBuilder<BlockState.StateMatcher,BlockState.MatcherBuilder>
BlockState.StateMatcher
s.Modifier and Type | Method and Description |
---|---|
BlockState.StateMatcher |
build()
Creates a new
BlockState.StateMatcher . |
BlockState.MatcherBuilder |
from(BlockState.StateMatcher value)
Resets this builder to the values of the given built object.
|
BlockState.MatcherBuilder |
reset()
Resets this builder to a "default" state such that there is no
remaining data to set.
|
<T extends Comparable<T>> |
trait(BlockTrait<T> trait,
T value)
Adds the desired
BlockTrait and {code value} to this
builder, if the desired BlockTrait does not belong to the
original BlockType as provided by type(BlockType) ,
an exception is thrown. |
BlockState.MatcherBuilder |
type(BlockType type)
Sets the root
BlockType for the BlockState.StateMatcher . |
public BlockState.MatcherBuilder type(BlockType type)
BlockType
for the BlockState.StateMatcher
.
Note that the type
must be set prior
to setting various traits
and their values.
type
- The block type to usepublic <T extends Comparable<T>> BlockState.MatcherBuilder trait(BlockTrait<T> trait, T value) throws IllegalArgumentException
BlockTrait
and {code value} to this
builder, if the desired BlockTrait
does not belong to the
original BlockType
as provided by type(BlockType)
,
an exception is thrown. Likewise, if a value
is not within
the possible values for the desired trait of the desired type, an
exception is thrown.T
- The type of comparabletrait
- The desired block traitvalue
- the desired valueIllegalArgumentException
- If the block trait does not match
the block type, or if the value does not belong to the trait
with the desired block typepublic BlockState.StateMatcher build() throws IllegalStateException
BlockState.StateMatcher
.IllegalStateException
- If there is no block typepublic BlockState.MatcherBuilder from(BlockState.StateMatcher value)
ResettableBuilder
from
in interface ResettableBuilder<BlockState.StateMatcher,BlockState.MatcherBuilder>
value
- The built objectpublic BlockState.MatcherBuilder reset()
ResettableBuilder
reset
in interface ResettableBuilder<BlockState.StateMatcher,BlockState.MatcherBuilder>