Interface ReloadableResourceManager

All Superinterfaces:
AutoCloseable, ResourceFactory, ResourceManager
All Known Implementing Classes:
ReloadableResourceManagerImpl

public interface ReloadableResourceManager extends ResourceManager, AutoCloseable
A resource manager that has a reload mechanism. Reloading allows reloaders to update when resources change. Accessing resources in reloads can reduce impact on game performance as well.

In each reload, all reloaders in this resource manager will have their reload called.

See Also:
Mappings:
Namespace Name
official afi
intermediary net/minecraft/class_3296
named net/minecraft/resource/ReloadableResourceManager
  • Method Details

    • reload

      default CompletableFuture<Unit> reload(Executor prepareExecutor, Executor applyExecutor, List<ResourcePack> packs, CompletableFuture<Unit> initialStage)
      Performs a reload. This returns a future that is completed when the reload is completed.
      Parameters:
      prepareExecutor - an executor for the prepare stage
      applyExecutor - an executor for the apply stage
      packs - a list of resource packs providing resources
      initialStage - a completable future to be completed before this reload
      Returns:
      the future of the reload
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lafi;a(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/List;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_14478 Lnet/minecraft/class_3296;method_14478(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/List;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;
      named reload Lnet/minecraft/resource/ReloadableResourceManager;reload(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/List;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;
    • reload

      ResourceReload reload(Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage, List<ResourcePack> packs)
      Performs a reload. Returns an object that yields some insights to the reload.

      prepareExecutor may be asynchronous. applyExecutor must synchronize with the game engine so changes are properly made to it. The reload will only begin after initialStage has completed. Earlier elements in packs have lower priorities.

      Parameters:
      prepareExecutor - an executor for the prepare stage
      applyExecutor - an executor for the apply stage
      initialStage - a completable future to be completed before this reload
      packs - a list of resource packs providing resources
      Returns:
      the reload
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lafi;a(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lafh;
      intermediary method_18232 Lnet/minecraft/class_3296;method_18232(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lnet/minecraft/class_4011;
      named reload Lnet/minecraft/resource/ReloadableResourceManager;reload(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lnet/minecraft/resource/ResourceReload;
    • registerReloader

      void registerReloader(ResourceReloader reloader)
      Registers a resource reloader to this manager.
      Parameters:
      reloader - the reloader
      Mappings:
      Namespace Name Mixin selector
      official a Lafi;a(Laff;)V
      intermediary method_14477 Lnet/minecraft/class_3296;method_14477(Lnet/minecraft/class_3302;)V
      named registerReloader Lnet/minecraft/resource/ReloadableResourceManager;registerReloader(Lnet/minecraft/resource/ResourceReloader;)V
    • close

      void close()
      Specified by:
      close in interface AutoCloseable