public class BlockState extends java.lang.Object implements BlockStateHolder<BlockState>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsFuzzy(BlockStateHolder<?> o)
Checks if the type is the same, and if the matched states are the same.
|
BlockType |
getBlockType()
Get the block type.
|
<V> V |
getState(Property<V> property)
Gets the value for the given state.
|
java.util.Map<Property<?>,java.lang.Object> |
getStates()
Gets an immutable collection of the states.
|
int |
hashCode() |
BaseBlock |
toBaseBlock()
Gets a
BaseBlock from this BlockStateHolder. |
BaseBlock |
toBaseBlock(CompoundTag compoundTag)
Gets a
BaseBlock from this BlockStateHolder. |
BlockState |
toImmutableState()
Returns an immutable
BlockState from this BlockStateHolder. |
java.lang.String |
toString() |
<V> BlockState |
with(Property<V> property,
V value)
Returns a BlockState with the given state and value applied.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
applyBlock, getAsString
public BlockType getBlockType()
BlockStateHolder
getBlockType
in interface BlockStateHolder<BlockState>
public <V> BlockState with(Property<V> property, V value)
BlockStateHolder
with
in interface BlockStateHolder<BlockState>
property
- The statevalue
- The valuepublic <V> V getState(Property<V> property)
BlockStateHolder
getState
in interface BlockStateHolder<BlockState>
property
- The statepublic java.util.Map<Property<?>,java.lang.Object> getStates()
BlockStateHolder
getStates
in interface BlockStateHolder<BlockState>
public boolean equalsFuzzy(BlockStateHolder<?> o)
BlockStateHolder
equalsFuzzy
in interface BlockStateHolder<BlockState>
o
- other blockpublic BlockState toImmutableState()
BlockStateHolder
BlockState
from this BlockStateHolder.toImmutableState
in interface BlockStateHolder<BlockState>
public BaseBlock toBaseBlock()
BlockStateHolder
BaseBlock
from this BlockStateHolder.toBaseBlock
in interface BlockStateHolder<BlockState>
public BaseBlock toBaseBlock(CompoundTag compoundTag)
BlockStateHolder
BaseBlock
from this BlockStateHolder.toBaseBlock
in interface BlockStateHolder<BlockState>
compoundTag
- The NBT Data to applypublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object