public class PixelBlockSnapshot
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
net.minecraft.util.ResourceLocation |
blockIdentifier
The mod ID of the block.
|
static java.lang.String |
PIXEL_SNAPSHOT_BLOCK_NAME
The NBT tag for a block's name
|
net.minecraft.util.math.BlockPos |
pos
The position of the block snapshot.
|
net.minecraft.block.BlockState |
replacedBlock
The block represented by the snapshot.
|
net.minecraft.world.World |
world
The world that the block snapshot is in.
|
| Constructor and Description |
|---|
PixelBlockSnapshot(net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.nbt.CompoundNBT nbt)
Raw constructor designed for serialization usages.
|
PixelBlockSnapshot(net.minecraft.util.math.BlockPos pos,
java.lang.String modid,
java.lang.String blockName,
net.minecraft.nbt.CompoundNBT nbt)
Raw constructor designed for serialization usages.
|
PixelBlockSnapshot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state)
Initializes a block snapshot.
|
PixelBlockSnapshot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.nbt.CompoundNBT nbt)
Initializes a block snapshot.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static PixelBlockSnapshot |
getBlockSnapshot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Creates a block snapshot for a position.
|
net.minecraft.block.BlockState |
getCurrentBlock()
Gets the block in the snapshot's position.
|
net.minecraft.block.BlockState |
getReplacedBlock()
Gets the block stored in the snapshot.
|
net.minecraft.tileentity.TileEntity |
getTileEntity()
Gets the tile entity in the snapshot.
|
int |
hashCode() |
static PixelBlockSnapshot |
readFromNBT(net.minecraft.nbt.CompoundNBT tag)
Reads a block snapshot from NBT data.
|
static PixelBlockSnapshot |
readFromNBT(net.minecraft.world.World newWorld,
net.minecraft.nbt.CompoundNBT tag)
Reads a block snapshot from NBT data.
|
boolean |
restore()
Restores the block in the snapshot.
|
boolean |
restore(boolean force)
Restores the block in the snapshot.
|
boolean |
restore(boolean force,
boolean applyPhysics)
Restores the block in the snapshot.
|
boolean |
restoreToLocation(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean force,
boolean applyPhysics)
Restores the block in the snapshot to a specific position.
|
void |
restoreToLocationWithRotation(net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction facing,
int yLevel,
boolean recreateTechnicalBlocks)
Restores the block in the snapshot to a position with a specific
rotation.
|
void |
restoreToLocationWithRotation(net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction facing,
int yLevel,
boolean recreateTechnicalBlocks,
net.minecraft.item.ItemStack replacement) |
void |
writeToNBT(net.minecraft.nbt.CompoundNBT compound)
Writes the block snapshot to NBT.
|
public static final java.lang.String PIXEL_SNAPSHOT_BLOCK_NAME
public final net.minecraft.util.math.BlockPos pos
public transient net.minecraft.block.BlockState replacedBlock
public transient net.minecraft.world.World world
public final net.minecraft.util.ResourceLocation blockIdentifier
public PixelBlockSnapshot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state)
world - The world the block snapshot is in.pos - The position of the block snapshot.state - The block.public PixelBlockSnapshot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.nbt.CompoundNBT nbt)
world - The world the block snapshot is in.pos - The position of the block snapshot.state - The block.nbt - The NBT data for the block.public PixelBlockSnapshot(net.minecraft.util.math.BlockPos pos,
java.lang.String modid,
java.lang.String blockName,
net.minecraft.nbt.CompoundNBT nbt)
pos - The position of the block snapshot.modid - The mod ID of the block.blockName - The name of the block.nbt - The NBT data for the block.public PixelBlockSnapshot(net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.nbt.CompoundNBT nbt)
pos - The position of the block snapshot.state - The block state.nbt - The NBT data for the block.public static PixelBlockSnapshot readFromNBT(net.minecraft.world.World newWorld, net.minecraft.nbt.CompoundNBT tag)
newWorld - The world the block snapshot is to be loaded in.tag - The block snapshot's NBT data.public static PixelBlockSnapshot getBlockSnapshot(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
world - The world to create a block snapshot for.pos - The position to create a block snapshot for.public static PixelBlockSnapshot readFromNBT(net.minecraft.nbt.CompoundNBT tag)
tag - The block snapshot's NBT data.public net.minecraft.block.BlockState getCurrentBlock()
public net.minecraft.tileentity.TileEntity getTileEntity()
public boolean restore()
public boolean restore(boolean force)
force - Whether to force the block to be restored if the existing
block at the position does not match it.public boolean restore(boolean force,
boolean applyPhysics)
force - Whether to force the block to be restored if the existing
block at the position does not match it.applyPhysics - Whether gravity-affected blocks should fall.public boolean restoreToLocation(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean force,
boolean applyPhysics)
world - The world to restore the block to.pos - The position to restore the block to.force - Whether to force the block to be restored if the existing
block at the position does not match it.applyPhysics - Whether gravity-affected blocks should fall.public void writeToNBT(net.minecraft.nbt.CompoundNBT compound)
compound - The NBT tag to write to.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic net.minecraft.block.BlockState getReplacedBlock()
public void restoreToLocationWithRotation(net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction facing,
int yLevel,
boolean recreateTechnicalBlocks)
pos - The position to restore the block to.facing - The direction that the block will face.public void restoreToLocationWithRotation(net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction facing,
int yLevel,
boolean recreateTechnicalBlocks,
net.minecraft.item.ItemStack replacement)