Class ModelDataManager
java.lang.Object
net.neoforged.neoforge.client.model.data.ModelDataManager
- Direct Known Subclasses:
ModelDataManager.Active
,ModelDataManager.Snapshot
public abstract sealed class ModelDataManager
extends Object
permits ModelDataManager.Active, ModelDataManager.Snapshot
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The active manager owned by the client's level and operated on the main client thread.static final class
A snapshot of the active manager's state in the specified sections at the point in time when a chunk section was prepared for re-rendering. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @Nullable ModelData
Returns theModelData
stored for the given position ornull
if none is present.abstract ModelData
getAtOrEmpty
(BlockPos pos) Returns theModelData
stored for the given position orModelData.EMPTY
if none is present.static void
onChunkUnload
(ChunkEvent.Unload event) abstract ModelDataManager.Snapshot
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.
-
Constructor Details
-
ModelDataManager
ModelDataManager()
-
-
Method Details
-
getAt
Returns theModelData
stored for the given position ornull
if none is present.- Parameters:
pos
- The position to query- Returns:
- the
ModelData
stored for the given position ornull
if none is present
-
getAtOrEmpty
Returns theModelData
stored for the given position orModelData.EMPTY
if none is present.- Parameters:
pos
- The position to query- Returns:
- the
ModelData
stored for the given position orModelData.EMPTY
if none is present
-
snapshotSectionRegion
@Internal public abstract ModelDataManager.Snapshot 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.- Throws:
IllegalArgumentException
- if this is a snapshot and the given region doesn't match the snapshot's region
-
onChunkUnload
-