Package net.minecraft.resource
Interface ResourceReloader
- All Known Subinterfaces:
SynchronousResourceReloader
- All Known Implementing Classes:
BakedModelManager
,BlockEntityRenderDispatcher
,BlockRenderManager
,BuiltinModelItemRenderer
,CloudRenderer
,EntityModelLoader
,EntityRenderDispatcher
,EquipmentModelLoader
,FoliageColormapResourceSupplier
,FontManager
,FunctionLoader
,GrassColormapResourceSupplier
,GuiAtlasManager
,ItemRenderer
,JsonDataLoader
,LanguageManager
,MapDecorationsAtlasManager
,PaintingManager
,ParticleManager
,PeriodicNotificationManager
,ServerAdvancementLoader
,ServerRecipeManager
,ShaderLoader
,SinglePreparationResourceReloader
,SoundManager
,SplashTextResourceSupplier
,SpriteAtlasHolder
,StatusEffectSpriteManager
,TextureManager
,VideoWarningManager
,WorldRenderer
public interface ResourceReloader
A resource reloader performs actual reloading in its reload when called by
SimpleResourceReload.start(net.minecraft.resource.ResourceManager, java.util.List<net.minecraft.resource.ResourceReloader>, java.util.concurrent.Executor, java.util.concurrent.Executor, java.util.concurrent.CompletableFuture<net.minecraft.util.Unit>, boolean)
.- See Also:
- Mappings:
Namespace Name named net/minecraft/resource/ResourceReloader
intermediary net/minecraft/class_3302
official avp
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A synchronizer to indicate completion of a reloader's prepare stage and to allow start of the apply stage only if all reloaders have finished the prepare stage. -
Method Summary
Modifier and TypeMethodDescriptiondefault String
getName()
Returns a user-friendly name for logging.reload
(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor) Performs a reload.
-
Method Details
-
reload
CompletableFuture<Void> reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor) Performs a reload. Returns a future that is completed when the reload is completed.In a reload, there is a prepare stage and an apply stage. For the prepare stage, you should create completable futures with CompletableFuture.supplyAsync(..., prepareExecutor) to ensure the prepare actions are done with the prepare executor. Then, you should have a completable future for all the prepared actions, and call combinedPrepare.thenCompose(synchronizer::waitFor) to notify the
synchronizer
. Finally, you should run CompletableFuture.thenAcceptAsync(..., applyExecutor) for apply actions. In the end, returns the result ofthenAcceptAsync
.- Parameters:
synchronizer
- the synchronizermanager
- the resource manager- Returns:
- a future for the reload
- See Also:
- Mappings:
Namespace Name Mixin selector named reload
Lnet/minecraft/resource/ResourceReloader;reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
intermediary method_25931
Lnet/minecraft/class_3302;method_25931(Lnet/minecraft/class_3302$class_4045;Lnet/minecraft/class_3300;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
official a
Lavp;a(Lavp$a;Lavv;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
-
getName
Returns a user-friendly name for logging.- Mappings:
Namespace Name Mixin selector named getName
Lnet/minecraft/resource/ResourceReloader;getName()Ljava/lang/String;
intermediary method_22322
Lnet/minecraft/class_3302;method_22322()Ljava/lang/String;
official c
Lavp;c()Ljava/lang/String;
-