Class PixelBlockSnapshot
java.lang.Object
com.pixelmonmod.pixelmon.api.util.PixelBlockSnapshot
Created by clienthax on 15/3/2015. Massively modified by MrM.
-
Field Summary
Modifier and TypeFieldDescriptionfinal net.minecraft.resources.ResourceLocation
The mod ID of the block.static final String
The NBT tag for a block's namefinal net.minecraft.core.BlockPos
The position of the block snapshot.net.minecraft.world.level.block.state.BlockState
The block represented by the snapshot.net.minecraft.world.level.Level
The world that the block snapshot is in. -
Constructor Summary
ConstructorDescriptionPixelBlockSnapshot
(net.minecraft.core.BlockPos pos, String modid, String blockName, net.minecraft.nbt.CompoundTag nbt) Raw constructor designed for serialization usages.PixelBlockSnapshot
(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.nbt.CompoundTag nbt) Raw constructor designed for serialization usages.PixelBlockSnapshot
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Initializes a block snapshot.PixelBlockSnapshot
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.nbt.CompoundTag nbt) Initializes a block snapshot. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static PixelBlockSnapshot
getBlockSnapshot
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Creates a block snapshot for a position.net.minecraft.world.level.block.state.BlockState
Gets the block in the snapshot's position.int
hashCode()
static PixelBlockSnapshot
readFromNBT
(net.minecraft.nbt.CompoundTag tag) Reads a block snapshot from NBT data.static PixelBlockSnapshot
readFromNBT
(net.minecraft.world.level.Level newWorld, net.minecraft.nbt.CompoundTag tag) Reads a block snapshot from NBT data.void
writeToNBT
(net.minecraft.nbt.CompoundTag compound) Writes the block snapshot to NBT.
-
Field Details
-
PIXEL_SNAPSHOT_BLOCK_NAME
The NBT tag for a block's name- See Also:
-
pos
public final net.minecraft.core.BlockPos posThe position of the block snapshot. -
replacedBlock
public transient net.minecraft.world.level.block.state.BlockState replacedBlockThe block represented by the snapshot. -
world
public transient net.minecraft.world.level.Level worldThe world that the block snapshot is in. -
blockIdentifier
public final net.minecraft.resources.ResourceLocation blockIdentifierThe mod ID of the block.
-
-
Constructor Details
-
PixelBlockSnapshot
public PixelBlockSnapshot(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Initializes a block snapshot.- Parameters:
world
- The world the block snapshot is in.pos
- The position of the block snapshot.state
- The block.
-
PixelBlockSnapshot
public PixelBlockSnapshot(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.nbt.CompoundTag nbt) Initializes a block snapshot.- Parameters:
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.
-
PixelBlockSnapshot
public PixelBlockSnapshot(net.minecraft.core.BlockPos pos, String modid, String blockName, net.minecraft.nbt.CompoundTag nbt) Raw constructor designed for serialization usages.- Parameters:
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.
-
PixelBlockSnapshot
public PixelBlockSnapshot(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.nbt.CompoundTag nbt) Raw constructor designed for serialization usages.- Parameters:
pos
- The position of the block snapshot.state
- The block state.nbt
- The NBT data for the block.
-
-
Method Details
-
readFromNBT
public static PixelBlockSnapshot readFromNBT(net.minecraft.world.level.Level newWorld, net.minecraft.nbt.CompoundTag tag) Reads a block snapshot from NBT data.- Parameters:
newWorld
- The world the block snapshot is to be loaded in.tag
- The block snapshot's NBT data.- Returns:
- The block snapshot loaded from NBT data.
-
getBlockSnapshot
public static PixelBlockSnapshot getBlockSnapshot(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Creates a block snapshot for a position.- Parameters:
world
- The world to create a block snapshot for.pos
- The position to create a block snapshot for.- Returns:
- A block snapshot of the specified position.
-
readFromNBT
Reads a block snapshot from NBT data.- Parameters:
tag
- The block snapshot's NBT data.- Returns:
- The block snapshot loaded from NBT data.
-
getCurrentBlock
public net.minecraft.world.level.block.state.BlockState getCurrentBlock()Gets the block in the snapshot's position.- Returns:
- The block in the snapshot's position.
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag compound) Writes the block snapshot to NBT.- Parameters:
compound
- The NBT tag to write to.
-
equals
-
hashCode
public int hashCode()
-