Package net.minecraftforge.common.util
Class BlockSnapshot
- java.lang.Object
-
- net.minecraftforge.common.util.BlockSnapshot
-
public class BlockSnapshot extends java.lang.ObjectRepresents 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
Fields Modifier and Type Field Description private BlockStateblockprivate static booleanDEBUGprivate RegistryKey<World>dimprivate intflagsprivate CompoundNBTnbtprivate BlockPosposprivate java.lang.StringtoStringprivate java.lang.ref.WeakReference<IWorld>world
-
Constructor Summary
Constructors Modifier Constructor Description privateBlockSnapshot(RegistryKey<World> dim, IWorld world, BlockPos pos, BlockState state, CompoundNBT nbt, int flags)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BlockSnapshotcreate(RegistryKey<World> dim, IWorld world, BlockPos pos)static BlockSnapshotcreate(RegistryKey<World> dim, IWorld world, BlockPos pos, int flag)booleanequals(java.lang.Object obj)BlockStategetCurrentBlock()intgetFlag()CompoundNBTgetNbt()BlockPosgetPos()BlockStategetReplacedBlock()TileEntitygetTileEntity()private static CompoundNBTgetTileNBT(TileEntity te)IWorldgetWorld()inthashCode()booleanrestore()booleanrestore(boolean force)booleanrestore(boolean force, boolean notifyNeighbors)booleanrestoreToLocation(IWorld world, BlockPos pos, boolean force, boolean notifyNeighbors)java.lang.StringtoString()
-
-
-
Field Detail
-
DEBUG
private static final boolean DEBUG
-
dim
private final RegistryKey<World> dim
-
pos
private final BlockPos pos
-
flags
private final int flags
-
block
private final BlockState block
-
nbt
@Nullable private final CompoundNBT nbt
-
world
@Nullable private java.lang.ref.WeakReference<IWorld> world
-
toString
private java.lang.String toString
-
-
Constructor Detail
-
BlockSnapshot
private BlockSnapshot(RegistryKey<World> dim, IWorld world, BlockPos pos, BlockState state, @Nullable CompoundNBT nbt, int flags)
-
-
Method Detail
-
create
public static BlockSnapshot create(RegistryKey<World> dim, IWorld world, BlockPos pos)
-
create
public static BlockSnapshot create(RegistryKey<World> dim, IWorld world, BlockPos pos, int flag)
-
getTileNBT
@Nullable private static CompoundNBT getTileNBT(@Nullable TileEntity te)
-
getCurrentBlock
public BlockState getCurrentBlock()
-
getWorld
@Nullable public IWorld getWorld()
-
getReplacedBlock
public BlockState getReplacedBlock()
-
getTileEntity
@Nullable public TileEntity getTileEntity()
-
restore
public boolean restore()
-
restore
public boolean restore(boolean force)
-
restore
public boolean restore(boolean force, boolean notifyNeighbors)
-
restoreToLocation
public boolean restoreToLocation(IWorld world, BlockPos pos, boolean force, boolean notifyNeighbors)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getPos
public BlockPos getPos()
-
getFlag
public int getFlag()
-
getNbt
@Nullable public CompoundNBT getNbt()
-
-