类 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.
-
字段概要
字段修饰符和类型字段说明private final BlockState
private static final boolean
private final ResourceKey
<Level> private final int
private @Nullable WeakReference
<LevelAccessor> private final @Nullable CompoundTag
private final BlockPos
private String
-
构造器概要
构造器限定符构造器说明private
BlockSnapshot
(ResourceKey<Level> dim, LevelAccessor level, BlockPos pos, BlockState state, @Nullable CompoundTag nbt, int flags) -
方法概要
修饰符和类型方法说明static BlockSnapshot
create
(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos) static BlockSnapshot
create
(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos, int flag) boolean
private static @Nullable CompoundTag
getBlockEntityTag
(@Nullable BlockEntity te, HolderLookup.Provider lookup) int
getFlag()
@Nullable LevelAccessor
getLevel()
getPos()
@Nullable CompoundTag
getTag()
int
hashCode()
boolean
restore()
boolean
restore
(boolean force) boolean
restore
(boolean force, boolean notifyNeighbors) boolean
restoreToLocation
(LevelAccessor world, BlockPos pos, boolean force, boolean notifyNeighbors) toString()
-
字段详细资料
-
DEBUG
private static final boolean DEBUG -
dim
-
pos
-
flags
private final int flags -
block
-
nbt
-
level
-
toString
-
-
构造器详细资料
-
BlockSnapshot
private BlockSnapshot(ResourceKey<Level> dim, LevelAccessor level, BlockPos pos, BlockState state, @Nullable @Nullable CompoundTag nbt, int flags)
-
-
方法详细资料
-
create
-
create
public static BlockSnapshot create(ResourceKey<Level> dim, LevelAccessor world, BlockPos pos, int flag) -
getBlockEntityTag
@Nullable private static @Nullable CompoundTag getBlockEntityTag(@Nullable @Nullable BlockEntity te, HolderLookup.Provider lookup) -
getCurrentBlock
-
getLevel
-
getReplacedBlock
-
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
-