Package net.minecraftforge.common.util
Class BlockSnapshot
- java.lang.Object
-
- net.minecraftforge.common.util.BlockSnapshot
-
public class BlockSnapshot extends java.lang.Object
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
Fields Modifier and Type Field Description private BlockState
block
private static boolean
DEBUG
private RegistryKey<World>
dim
private int
flags
private CompoundNBT
nbt
private BlockPos
pos
private java.lang.String
toString
private java.lang.ref.WeakReference<IWorld>
world
-
Constructor Summary
Constructors Modifier Constructor Description private
BlockSnapshot(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 BlockSnapshot
create(RegistryKey<World> dim, IWorld world, BlockPos pos)
static BlockSnapshot
create(RegistryKey<World> dim, IWorld world, BlockPos pos, int flag)
boolean
equals(java.lang.Object obj)
BlockState
getCurrentBlock()
int
getFlag()
CompoundNBT
getNbt()
BlockPos
getPos()
BlockState
getReplacedBlock()
TileEntity
getTileEntity()
private static CompoundNBT
getTileNBT(TileEntity te)
IWorld
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)
java.lang.String
toString()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getPos
public BlockPos getPos()
-
getFlag
public int getFlag()
-
getNbt
@Nullable public CompoundNBT getNbt()
-
-