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 SummaryFieldsModifier and TypeFieldDescriptionprivate final BlockStateprivate static final booleanprivate final ResourceKey<Level>private final intprivate @Nullable WeakReference<LevelAccessor>private final @Nullable CompoundTagprivate final BlockPosprivate String
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateBlockSnapshot(ResourceKey<Level> dim, LevelAccessor level, BlockPos pos, BlockState state, @Nullable CompoundTag nbt, int flags) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic BlockSnapshotcreate(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos) static BlockSnapshotcreate(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos, int flag) boolean@Nullable BlockEntityprivate static @Nullable CompoundTaggetBlockEntityTag(@Nullable BlockEntity te) intgetFlag()@Nullable LevelAccessorgetLevel()getPos()@Nullable CompoundTaggetTag()inthashCode()booleanrestore()booleanrestore(boolean force) booleanrestore(boolean force, boolean notifyNeighbors) booleanrestoreToLocation(LevelAccessor world, BlockPos pos, boolean force, boolean notifyNeighbors) toString()
- 
Field Details- 
DEBUGprivate static final boolean DEBUG
- 
dim
- 
pos
- 
flagsprivate final int flags
- 
block
- 
nbt
- 
level
- 
toString
 
- 
- 
Constructor Details- 
BlockSnapshotprivate BlockSnapshot(ResourceKey<Level> dim, LevelAccessor level, BlockPos pos, BlockState state, @Nullable @Nullable CompoundTag nbt, int flags) 
 
- 
- 
Method Details- 
create
- 
createpublic static BlockSnapshot create(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos, int flag) 
- 
getBlockEntityTag@Nullable private static @Nullable CompoundTag getBlockEntityTag(@Nullable @Nullable BlockEntity te) 
- 
getCurrentBlock
- 
getLevel
- 
getReplacedBlock
- 
getBlockEntity
- 
restorepublic boolean restore()
- 
restorepublic boolean restore(boolean force) 
- 
restorepublic boolean restore(boolean force, boolean notifyNeighbors) 
- 
restoreToLocationpublic boolean restoreToLocation(LevelAccessor world, BlockPos pos, boolean force, boolean notifyNeighbors) 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
getPos
- 
getFlagpublic int getFlag()
- 
getTag
 
-