public class BlockSnapshot
extends java.lang.Object
Unlike Block, which only one object can exist per coordinate, BlockSnapshot can exist multiple times for any given Block.
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
private int |
dimId |
private int |
flag |
private int |
meta |
private CompoundNBT |
nbt |
private BlockPos |
pos |
private ResourceLocation |
registryName |
private BlockState |
replacedBlock |
private java.lang.ref.WeakReference<IWorld> |
world |
Constructor and Description |
---|
BlockSnapshot(int dimension,
BlockPos pos,
ResourceLocation registryName,
int meta,
int flag,
CompoundNBT nbt)
Raw constructor designed for serialization usages.
|
BlockSnapshot(IWorld world,
BlockPos pos,
BlockState state) |
BlockSnapshot(IWorld world,
BlockPos pos,
BlockState state,
CompoundNBT nbt) |
BlockSnapshot(IWorld world,
BlockPos pos,
BlockState state,
int flag) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static BlockSnapshot |
getBlockSnapshot(IWorld world,
BlockPos pos) |
static BlockSnapshot |
getBlockSnapshot(IWorld world,
BlockPos pos,
int flag) |
BlockState |
getCurrentBlock() |
int |
getDimId() |
int |
getFlag() |
int |
getMeta() |
CompoundNBT |
getNbt() |
BlockPos |
getPos() |
ResourceLocation |
getRegistryName() |
BlockState |
getReplacedBlock() |
TileEntity |
getTileEntity() |
private static CompoundNBT |
getTileNBT(TileEntity te) |
IWorld |
getWorld() |
int |
hashCode() |
static BlockSnapshot |
readFromNBT(CompoundNBT tag) |
boolean |
restore() |
boolean |
restore(boolean force) |
boolean |
restore(boolean force,
boolean notifyNeighbors) |
boolean |
restoreToLocation(IWorld world,
BlockPos pos,
boolean force,
boolean notifyNeighbors) |
void |
setFlag(int flag) |
void |
setReplacedBlock(BlockState replacedBlock) |
void |
setWorld(IWorld world) |
void |
writeToNBT(CompoundNBT compound) |
private static final boolean DEBUG
private final BlockPos pos
private final int dimId
@Nullable private BlockState replacedBlock
private int flag
@Nullable private final CompoundNBT nbt
@Nullable private java.lang.ref.WeakReference<IWorld> world
private final ResourceLocation registryName
private final int meta
public BlockSnapshot(IWorld world, BlockPos pos, BlockState state)
public BlockSnapshot(IWorld world, BlockPos pos, BlockState state, @Nullable CompoundNBT nbt)
public BlockSnapshot(IWorld world, BlockPos pos, BlockState state, int flag)
public BlockSnapshot(int dimension, BlockPos pos, ResourceLocation registryName, int meta, int flag, @Nullable CompoundNBT nbt)
public static BlockSnapshot getBlockSnapshot(IWorld world, BlockPos pos)
public static BlockSnapshot getBlockSnapshot(IWorld world, BlockPos pos, int flag)
public static BlockSnapshot readFromNBT(CompoundNBT tag)
@Nullable private static CompoundNBT getTileNBT(@Nullable TileEntity te)
public BlockState getCurrentBlock()
public IWorld getWorld()
public BlockState getReplacedBlock()
@Nullable public TileEntity getTileEntity()
public boolean restore()
public boolean restore(boolean force)
public boolean restore(boolean force, boolean notifyNeighbors)
public boolean restoreToLocation(IWorld world, BlockPos pos, boolean force, boolean notifyNeighbors)
public void writeToNBT(CompoundNBT compound)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public BlockPos getPos()
public int getDimId()
public void setReplacedBlock(BlockState replacedBlock)
public int getFlag()
public void setFlag(int flag)
@Nullable public CompoundNBT getNbt()
public void setWorld(IWorld world)
public ResourceLocation getRegistryName()
public int getMeta()