接口 ResourceReloader
-
- 所有已知子接口:
SynchronousResourceReloader
- 所有已知实现类:
BakedModelManager,BlockEntityRenderDispatcher,BlockRenderManager,BuiltinModelItemRenderer,EntityModelLoader,EntityRenderDispatcher,FoliageColormapResourceSupplier,FunctionLoader,GameRenderer,GrassColormapResourceSupplier,ItemRenderer,JsonDataLoader,LanguageManager,LootConditionManager,LootFunctionManager,LootManager,PaintingManager,ParticleManager,RecipeManager,SearchManager,ServerAdvancementLoader,SinglePreparationResourceReloader,SoundManager,SplashTextResourceSupplier,SpriteAtlasHolder,StatusEffectSpriteManager,TagManagerLoader,TextureManager,VideoWarningManager,WorldRenderer
public interface ResourceReloaderA resource reloader performs actual reloading in its reload in a reloadable resource manager it is registered to.- 另请参阅:
ReloadableResourceManager,SinglePreparationResourceReloader (completes preparation in one method),SynchronousResourceReloader (performs all reloading in the apply executor)- Mappings:
Namespace Name official adgintermediary net/minecraft/class_3302named net/minecraft/resource/ResourceReloader
-
-
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static interfaceResourceReloader.SynchronizerA 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.
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default StringgetName()Returns a user-friendly name for logging.CompletableFuture<Void>reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor)Performs a reload.
-
-
-
方法详细资料
-
reload
CompletableFuture<Void> reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, 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.- 参数:
synchronizer- the synchronizermanager- the resource managerprepareProfiler- the profiler for prepare stageapplyProfiler- the profiler for apply stageprepareExecutor- the executor for prepare stageapplyExecutor- the executor for apply stage- 返回:
- a future for the reload
- 另请参阅:
ReloadableResourceManager.reload(Executor, Executor, CompletableFuture, List)- Mappings:
Namespace Name Mixin selector official aLadg;a(Ladg$a;Ladl;Lapl;Lapl;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;intermediary method_25931Lnet/minecraft/class_3302;method_25931(Lnet/minecraft/class_3302$class_4045;Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;Lnet/minecraft/class_3695;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;named reloadLnet/minecraft/resource/ResourceReloader;reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;Lnet/minecraft/util/profiler/Profiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
-
getName
default String getName()
Returns a user-friendly name for logging.- Mappings:
Namespace Name Mixin selector official cLadg;c()Ljava/lang/String;intermediary method_22322Lnet/minecraft/class_3302;method_22322()Ljava/lang/String;named getNameLnet/minecraft/resource/ResourceReloader;getName()Ljava/lang/String;
-
-