public interface BlockSnapshot extends LocateableSnapshot<BlockSnapshot>
BlockState
and any extra data that
may be associated with it, including TileEntity
related data..Modifier and Type | Method and Description |
---|---|
BlockState |
getState()
Gets the
BlockState . |
boolean |
restore(boolean force,
boolean notifyNeighbors)
Restores the
BlockSnapshot to the Location stored within
the snapshot. |
BlockSnapshot |
withContainer(DataContainer container)
Creates a copy of the
BlockSnapshot with the provided
DataContainer . |
BlockSnapshot |
withState(BlockState blockState)
Creates a copy of the
BlockSnapshot with the provided
BlockState . |
getLocation, getPosition, getWorldUniqueId, withLocation
getManipulators
toContainer
getApplicableProperties, getProperty
get, getContainers, getOrCreate, merge, merge, supports, transform, with, with, with, with, without
BlockState getState()
BlockState
.BlockSnapshot withState(BlockState blockState)
BlockSnapshot
with the provided
BlockState
. Any additional data associated with a
TileEntity
or custom data may be lost.
Note: all custom data, including implementation detailed
data relating to any and all TileEntity
instances that
was included in this snapshot will NOT copy over to the new
snapshot.
blockState
- The block stateBlockSnapshot withContainer(DataContainer container)
BlockSnapshot
with the provided
DataContainer
. Note that this is equal to calling
DataBuilder.build(DataView)
. All data is
validated andcontainer
- The data containerboolean restore(boolean force, boolean notifyNeighbors)
BlockSnapshot
to the Location
stored within
the snapshot. If the Location
is not available, the snapshot will
not be restored.
If forced, the state of the block will change its BlockType
to match that of the snapshot then set the state. However, if force is
set to false and the BlockType
s does not match, false will be
returned.
If notifyNeighbors is true, neighboring blocks will be notified of
changes at the restored block location triggering physic updates.
force
- If true, forces block state to be set even if the
BlockType
does not match the snapshot one.notifyNeighbors
- If true, notifies neighboring blocks to update
physics