Package com.sk89q.worldedit.world.block
Interface BlockStateHolder<B extends BlockStateHolder<B>>
- All Superinterfaces:
Pattern
- All Known Implementing Classes:
BaseBlock
,BlockState
,FuzzyBlockState
,MobSpawnerBlock
,SignBlock
,SkullBlock
-
Method Summary
Modifier and TypeMethodDescriptiondefault BaseBlock
applyBlock
(BlockVector3 position) Return aBaseBlock
for the given position.boolean
equalsFuzzy
(BlockStateHolder<?> o) Checks if the type is the same, and if the matched states are the same.default String
Get the block type.<V> V
Gets the value for the given state.Gets an immutable collection of the states.Gets aBaseBlock
from this BlockStateHolder.toBaseBlock
(CompoundTag compoundTag) Gets aBaseBlock
from this BlockStateHolder.Returns an immutableBlockState
from this BlockStateHolder.<V> B
Returns a BlockState with the given state and value applied.
-
Method Details
-
getBlockType
BlockType getBlockType()Get the block type.- Returns:
- The type
-
with
Returns a BlockState with the given state and value applied.- Parameters:
property
- The statevalue
- The value- Returns:
- The modified state, or same if could not be applied
-
getState
Gets the value for the given state.- Parameters:
property
- The state- Returns:
- The value
-
getStates
Gets an immutable collection of the states.- Returns:
- The states
-
equalsFuzzy
Checks if the type is the same, and if the matched states are the same.- Parameters:
o
- other block- Returns:
- true if equal
-
toImmutableState
BlockState toImmutableState()Returns an immutableBlockState
from this BlockStateHolder.- Returns:
- A BlockState
-
toBaseBlock
BaseBlock toBaseBlock()Gets aBaseBlock
from this BlockStateHolder.- Returns:
- The BaseBlock
-
toBaseBlock
Gets aBaseBlock
from this BlockStateHolder.- Parameters:
compoundTag
- The NBT Data to apply- Returns:
- The BaseBlock
-
applyBlock
Description copied from interface:Pattern
Return aBaseBlock
for the given position.- Specified by:
applyBlock
in interfacePattern
- Parameters:
position
- the position- Returns:
- a block
-
getAsString
-