类 ModelDataManager
java.lang.Object
net.neoforged.neoforge.model.data.ModelDataManager
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Retrieves model data for a block at the given position.@UnmodifiableView it.unimi.dsi.fastutil.longs.Long2ObjectMap
<ModelData> getAt
(SectionPos pos) Provides all the model data for a given chunk section.private boolean
static void
onChunkUnload
(ChunkEvent.Unload event) private void
refreshAt
(long section) void
requestRefresh
(BlockEntity blockEntity) Request a refresh of the stored data for the givenBlockEntity
.it.unimi.dsi.fastutil.longs.Long2ObjectFunction
<ModelData> snapshotSectionRegion
(int sectionMinX, int sectionMinY, int sectionMinZ, int sectionMaxX, int sectionMaxY, int sectionMaxZ) Snapshot the state of this manager for all sections in the volume specified by the given section coordinates.
-
字段详细资料
-
owningThread
-
level
-
needModelDataRefresh
-
modelDataCache
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.longs.Long2ObjectMap<ModelData>> modelDataCache -
EMPTY_SNAPSHOT
-
-
构造器详细资料
-
ModelDataManager
-
-
方法详细资料
-
requestRefresh
Request a refresh of the stored data for the givenBlockEntity
. The givenBlockEntity
must be in the level owning this manager -
getAt
public @UnmodifiableView it.unimi.dsi.fastutil.longs.Long2ObjectMap<ModelData> getAt(SectionPos pos) Provides all the model data for a given chunk section. This is useful for mods which wish to retrieve a fast view of the model data for a single section in a level.The returned map must be copied if it needs to be accessed from another thread, as it may be modified by this data manager.
- 参数:
pos
- the section to query- 返回:
- an (unmodifiable) map containing the
ModelData
stored for the given chunk section
-
getAt
Retrieves model data for a block at the given position.- 参数:
pos
- the position to query- 返回:
- the model data at this position, or
ModelData.EMPTY
if none exists
-
snapshotSectionRegion
public it.unimi.dsi.fastutil.longs.Long2ObjectFunction<ModelData> snapshotSectionRegion(int sectionMinX, int sectionMinY, int sectionMinZ, int sectionMaxX, int sectionMaxY, int sectionMaxZ) Snapshot the state of this manager for all sections in the volume specified by the given section coordinates. The snapshot will returnModelData.EMPTY
for nonexistent keys. -
refreshAt
private void refreshAt(long section) -
isOtherThread
private boolean isOtherThread() -
onChunkUnload
-