Class ModelDataManager.Active

java.lang.Object
net.neoforged.neoforge.client.model.data.ModelDataManager
net.neoforged.neoforge.client.model.data.ModelDataManager.Active
Enclosing class:
ModelDataManager

@Internal public static final class ModelDataManager.Active extends ModelDataManager
The active manager owned by the client's level and operated on the main client thread.

Users should not be instantiating this themselves unless they know what they're doing.

  • Field Details

    • owningThread

      private final Thread owningThread
    • level

      private final Level level
    • needModelDataRefresh

      private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Set<BlockPos>> needModelDataRefresh
    • modelDataCache

      private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.longs.Long2ObjectMap<ModelData>> modelDataCache
  • Constructor Details

    • Active

      public Active(Level level)
  • Method Details

    • requestRefresh

      public void requestRefresh(BlockEntity blockEntity)
      Request a refresh of the stored data for the given BlockEntity. The given BlockEntity must be in the level owning this manager
    • getAt

      @Nullable public @Nullable ModelData getAt(BlockPos pos)
      Description copied from class: ModelDataManager
      Returns the ModelData stored for the given position or null if none is present.
      Specified by:
      getAt in class ModelDataManager
      Parameters:
      pos - The position to query
      Returns:
      the ModelData stored for the given position or null if none is present
    • getAtOrEmpty

      public ModelData getAtOrEmpty(BlockPos pos)
      Description copied from class: ModelDataManager
      Returns the ModelData stored for the given position or ModelData.EMPTY if none is present.
      Specified by:
      getAtOrEmpty in class ModelDataManager
      Parameters:
      pos - The position to query
      Returns:
      the ModelData stored for the given position or ModelData.EMPTY if none is present
    • snapshotSectionRegion

      public ModelDataManager.Snapshot snapshotSectionRegion(int sectionMinX, int sectionMinY, int sectionMinZ, int sectionMaxX, int sectionMaxY, int sectionMaxZ)
      Description copied from class: ModelDataManager
      Snapshot the state of this manager for all sections in the volume specified by the given section coordinates.
      Specified by:
      snapshotSectionRegion in class ModelDataManager
    • refreshAt

      private void refreshAt(long section)
    • isOtherThread

      private boolean isOtherThread()