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:
- Mappings:
Namespace Name official afi
intermediary net/minecraft/class_3296
named net/minecraft/resource/ReloadableResourceManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceManager
ResourceManager.Empty
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
registerReloader
(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
getResource
Methods 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:
- 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 afterinitialStage
has completed. Earlier elements inpacks
have 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:
- 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
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 interfaceAutoCloseable
-