Package net.minecraftforge.common.util
Class BlockSnapshot
java.lang.Object
net.minecraftforge.common.util.BlockSnapshot
Represents a captured snapshot of a block which will not change
automatically.
Unlike Block, which only one object can exist per coordinate, BlockSnapshot can exist multiple times for any given Block.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BlockState
private static final boolean
private final RegistryKey<World>
private final int
private final CompoundNBT
private final BlockPos
private String
private WeakReference<IWorld>
-
Constructor Summary
ModifierConstructorDescriptionprivate
BlockSnapshot
(RegistryKey<World> dim, IWorld world, BlockPos pos, BlockState state, CompoundNBT nbt, int flags) -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockSnapshot
create
(RegistryKey<World> dim, IWorld world, BlockPos pos) static BlockSnapshot
create
(RegistryKey<World> dim, IWorld world, BlockPos pos, int flag) boolean
int
getFlag()
getNbt()
getPos()
private static CompoundNBT
getTileNBT
(TileEntity te) getWorld()
int
hashCode()
boolean
restore()
boolean
restore
(boolean force) boolean
restore
(boolean force, boolean notifyNeighbors) boolean
restoreToLocation
(IWorld world, BlockPos pos, boolean force, boolean notifyNeighbors) toString()
-
Field Details
-
DEBUG
private static final boolean DEBUG -
dim
-
pos
-
flags
private final int flags -
block
-
nbt
-
world
-
toString
-
-
Constructor Details
-
BlockSnapshot
private BlockSnapshot(RegistryKey<World> dim, IWorld world, BlockPos pos, BlockState state, @Nullable CompoundNBT nbt, int flags)
-
-
Method Details
-
create
-
create
-
getTileNBT
-
getCurrentBlock
-
getWorld
-
getReplacedBlock
-
getTileEntity
-
restore
public boolean restore() -
restore
public boolean restore(boolean force) -
restore
public boolean restore(boolean force, boolean notifyNeighbors) -
restoreToLocation
-
equals
-
hashCode
public int hashCode() -
toString
-
getPos
-
getFlag
public int getFlag() -
getNbt
-