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
A manager for the lifecycle of all the ModelData instances in a Level.
  • Constructor Details

    • ModelDataManager

      ModelDataManager()
  • Method Details

    • getAt

      @Nullable public abstract @Nullable ModelData getAt(BlockPos pos)
      Returns the ModelData stored for the given position or null if none is present.
      Parameters:
      pos - The position to query
      Returns:
      the ModelData stored for the given position or null if none is present
    • getAtOrEmpty

      public abstract ModelData getAtOrEmpty(BlockPos pos)
      Returns the ModelData stored for the given position or ModelData.EMPTY if none is present.
      Parameters:
      pos - The position to query
      Returns:
      the ModelData stored for the given position or ModelData.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

      public static void onChunkUnload(ChunkEvent.Unload event)