Package net.minecraftforge.common.util
Class BlockSnapshot
java.lang.Object
net.minecraftforge.common.util.BlockSnapshot
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
FieldsModifier and TypeFieldDescriptionprivate final BlockStateprivate static final booleanprivate final ResourceKey<Level>private final intprivate WeakReference<LevelAccessor>private final CompoundTagprivate final BlockPosprivate String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBlockSnapshot(ResourceKey<Level> dim, LevelAccessor level, BlockPos pos, BlockState state, CompoundTag nbt, int flags) -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockSnapshotcreate(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos) static BlockSnapshotcreate(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos, int flag) booleanprivate static CompoundTagintgetFlag()getLevel()getPos()getTag()inthashCode()booleanrestore()booleanrestore(boolean force) booleanrestore(boolean force, boolean notifyNeighbors) booleanrestoreToLocation(LevelAccessor world, BlockPos pos, boolean force, boolean notifyNeighbors) toString()
-
Field Details
-
DEBUG
private static final boolean DEBUG -
dim
-
pos
-
flags
private final int flags -
block
-
nbt
-
level
-
toString
-
-
Constructor Details
-
BlockSnapshot
private BlockSnapshot(ResourceKey<Level> dim, LevelAccessor level, BlockPos pos, BlockState state, @Nullable CompoundTag nbt, int flags)
-
-
Method Details
-
create
-
create
public static BlockSnapshot create(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos, int flag) -
getBlockEntityTag
-
getCurrentBlock
-
getLevel
-
getReplacedBlock
-
getBlockEntity
-
restore
public boolean restore() -
restore
public boolean restore(boolean force) -
restore
public boolean restore(boolean force, boolean notifyNeighbors) -
restoreToLocation
public boolean restoreToLocation(LevelAccessor world, BlockPos pos, boolean force, boolean notifyNeighbors) -
equals
-
hashCode
public int hashCode() -
toString
-
getPos
-
getFlag
public int getFlag() -
getTag
-