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 NBTTagCompound |
nbt |
private BlockPos |
pos |
private ResourceLocation |
registryName |
private IBlockState |
replacedBlock |
private java.lang.ref.WeakReference<World> |
world |
Constructor and Description |
---|
BlockSnapshot(int dimension,
BlockPos pos,
ResourceLocation registryName,
int meta,
int flag,
NBTTagCompound nbt)
Raw constructor designed for serialization usages.
|
BlockSnapshot(int dimension,
BlockPos pos,
java.lang.String modId,
java.lang.String blockName,
int meta,
int flag,
NBTTagCompound nbt)
|
BlockSnapshot(World world,
BlockPos pos,
IBlockState state) |
BlockSnapshot(World world,
BlockPos pos,
IBlockState state,
int flag) |
BlockSnapshot(World world,
BlockPos pos,
IBlockState state,
NBTTagCompound nbt) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static BlockSnapshot |
getBlockSnapshot(World world,
BlockPos pos) |
static BlockSnapshot |
getBlockSnapshot(World world,
BlockPos pos,
int flag) |
IBlockState |
getCurrentBlock() |
int |
getDimId() |
int |
getFlag() |
int |
getMeta() |
NBTTagCompound |
getNbt() |
BlockPos |
getPos() |
ResourceLocation |
getRegistryName() |
IBlockState |
getReplacedBlock() |
TileEntity |
getTileEntity() |
private static NBTTagCompound |
getTileNBT(TileEntity te) |
World |
getWorld() |
int |
hashCode() |
static BlockSnapshot |
readFromNBT(NBTTagCompound tag) |
boolean |
restore() |
boolean |
restore(boolean force) |
boolean |
restore(boolean force,
boolean notifyNeighbors) |
boolean |
restoreToLocation(World world,
BlockPos pos,
boolean force,
boolean notifyNeighbors) |
void |
setFlag(int flag) |
void |
setReplacedBlock(IBlockState replacedBlock) |
void |
setWorld(World world) |
void |
writeToNBT(NBTTagCompound compound) |
private static final boolean DEBUG
private final BlockPos pos
private final int dimId
@Nullable private IBlockState replacedBlock
private int flag
@Nullable private final NBTTagCompound nbt
@Nullable private java.lang.ref.WeakReference<World> world
private final ResourceLocation registryName
private final int meta
public BlockSnapshot(World world, BlockPos pos, IBlockState state)
public BlockSnapshot(World world, BlockPos pos, IBlockState state, @Nullable NBTTagCompound nbt)
public BlockSnapshot(World world, BlockPos pos, IBlockState state, int flag)
@Deprecated public BlockSnapshot(int dimension, BlockPos pos, java.lang.String modId, java.lang.String blockName, int meta, int flag, @Nullable NBTTagCompound nbt)
public BlockSnapshot(int dimension, BlockPos pos, ResourceLocation registryName, int meta, int flag, @Nullable NBTTagCompound nbt)
public static BlockSnapshot getBlockSnapshot(World world, BlockPos pos)
public static BlockSnapshot getBlockSnapshot(World world, BlockPos pos, int flag)
public static BlockSnapshot readFromNBT(NBTTagCompound tag)
@Nullable private static NBTTagCompound getTileNBT(@Nullable TileEntity te)
public IBlockState getCurrentBlock()
public World getWorld()
public IBlockState getReplacedBlock()
@Nullable public TileEntity getTileEntity()
public boolean restore()
public boolean restore(boolean force)
public boolean restore(boolean force, boolean notifyNeighbors)
public boolean restoreToLocation(World world, BlockPos pos, boolean force, boolean notifyNeighbors)
public void writeToNBT(NBTTagCompound 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(IBlockState replacedBlock)
public int getFlag()
public void setFlag(int flag)
@Nullable public NBTTagCompound getNbt()
public void setWorld(World world)
public ResourceLocation getRegistryName()
public int getMeta()