Package net.minecraft.resource
Interface ReloadableResourceManager
- All Superinterfaces:
AutoCloseable,ResourceFactory,ResourceManager
- All Known Implementing Classes:
ReloadableResourceManagerImpl
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:
ResourceReloader- Mappings:
Namespace Name official adrintermediary net/minecraft/class_3296named net/minecraft/resource/ReloadableResourceManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceManager
ResourceManager.Empty -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidregisterReloader(ResourceReloader reloader)Registers a resource reloader to this manager.reload(Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage, List<ResourcePack> packs)Performs a reload.default CompletableFuture<Unit>reload(Executor prepareExecutor, Executor applyExecutor, List<ResourcePack> packs, CompletableFuture<Unit> initialStage)Performs a reload.Methods inherited from interface net.minecraft.resource.ResourceFactory
getResourceMethods inherited from interface net.minecraft.resource.ResourceManager
containsResource, findResources, getAllNamespaces, getAllResources, streamResourcePacks
-
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 stageapplyExecutor- an executor for the apply stagepacks- a list of resource packs providing resourcesinitialStage- a completable future to be completed before this reload- Returns:
- the future of the reload
- See Also:
reload(Executor, Executor, CompletableFuture, List)- Mappings:
Namespace Name Mixin selector official aLadr;a(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/List;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;intermediary method_14478Lnet/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 reloadLnet/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.prepareExecutormay be asynchronous.applyExecutormust synchronize with the game engine so changes are properly made to it. The reload will only begin afterinitialStagehas completed. Earlier elements inpackshave lower priorities.- Parameters:
prepareExecutor- an executor for the prepare stageapplyExecutor- an executor for the apply stageinitialStage- a completable future to be completed before this reloadpacks- a list of resource packs providing resources- Returns:
- the reload
- See Also:
ResourceReloader.reload(net.minecraft.resource.ResourceReloader.Synchronizer, net.minecraft.resource.ResourceManager, net.minecraft.util.profiler.Profiler, net.minecraft.util.profiler.Profiler, java.util.concurrent.Executor, java.util.concurrent.Executor)- Mappings:
Namespace Name Mixin selector official aLadr;a(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Ladq;intermediary method_18232Lnet/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 reloadLnet/minecraft/resource/ReloadableResourceManager;reload(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lnet/minecraft/resource/ResourceReload;
-
registerReloader
Registers a resource reloader to this manager.- Parameters:
reloader- the reloader- Mappings:
Namespace Name Mixin selector official aLadr;a(Lado;)Vintermediary method_14477Lnet/minecraft/class_3296;method_14477(Lnet/minecraft/class_3302;)Vnamed registerReloaderLnet/minecraft/resource/ReloadableResourceManager;registerReloader(Lnet/minecraft/resource/ResourceReloader;)V
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-