public class BlockState extends Object
| Constructor and Description |
|---|
BlockState(BlockType type,
Map<BlockTrait<?>,Comparable<?>> traits) |
BlockState(BlockType type,
Map<BlockTrait<?>,Comparable<?>> traits,
BlockBehavior behavior) |
| Modifier and Type | Method and Description |
|---|---|
BlockState |
copyTraits(BlockState from) |
BlockState |
decrementTrait(IntegerBlockTrait trait) |
<T extends Comparable<T>> |
ensureTrait(BlockTrait<T> trait) |
BlockBehavior |
getBehavior() |
Map<BlockTrait<?>,Comparable<?>> |
getTraits() |
BlockType |
getType() |
boolean |
inCategory(BlockCategory category) |
BlockState |
incrementTrait(IntegerBlockTrait trait) |
void |
setBehavior(BlockBehavior behavior) |
BlockState |
toggleTrait(BooleanBlockTrait trait) |
String |
toString() |
<T extends Comparable<T>> |
withTrait(BlockTrait<T> trait,
T value) |
BlockState |
withTrait(BooleanBlockTrait trait,
boolean value) |
BlockState |
withTrait(IntegerBlockTrait trait,
int value) |
public BlockState(BlockType type, Map<BlockTrait<?>,Comparable<?>> traits)
public BlockState(BlockType type, Map<BlockTrait<?>,Comparable<?>> traits, BlockBehavior behavior)
public void setBehavior(BlockBehavior behavior)
public BlockType getType()
public Map<BlockTrait<?>,Comparable<?>> getTraits()
@Nonnull public <T extends Comparable<T>> BlockState withTrait(BlockTrait<T> trait, T value)
@Nonnull public BlockState withTrait(IntegerBlockTrait trait, int value)
@Nonnull public BlockState withTrait(BooleanBlockTrait trait, boolean value)
public <T extends Comparable<T>> T ensureTrait(BlockTrait<T> trait)
@Nonnull public BlockState copyTraits(BlockState from)
@Nonnull public BlockState incrementTrait(IntegerBlockTrait trait)
@Nonnull public BlockState decrementTrait(IntegerBlockTrait trait)
public boolean inCategory(BlockCategory category)
public BlockBehavior getBehavior()
public BlockState toggleTrait(BooleanBlockTrait trait)
Copyright © 2021. All rights reserved.