接口 SynchronousResourceReloader
-
- 所有超级接口:
ResourceReloader
- 所有已知实现类:
BlockEntityRenderDispatcher,BlockRenderManager,BuiltinModelItemRenderer,EntityModelLoader,EntityRenderDispatcher,GameRenderer,ItemRenderer,LanguageManager,SearchManager,WorldRenderer
public interface SynchronousResourceReloader extends ResourceReloader
A base resource reloader that does all its work in the apply executor, or the game engine's thread.- API Note:
- This resource reloader is useful as a resource reload callback that doesn't need resource manager access. If you access the resource manager, consider writing resource reloaders that have a proper prepare stage instead by moving resource manager access to the prepare stage. That can speed up resource reloaders significantly.
- Mappings:
Namespace Name official admintermediary net/minecraft/class_4013named net/minecraft/resource/SynchronousResourceReloader
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 net.minecraft.resource.ResourceReloader
ResourceReloader.Synchronizer
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 voidreload(ResourceManager manager)Performs the reload in the apply executor, or the game engine.default CompletableFuture<Void>reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor)Performs a reload.-
从接口继承的方法 net.minecraft.resource.ResourceReloader
getName
-
-
-
-
方法详细资料
-
reload
default 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.- 指定者:
reload在接口中ResourceReloader- 参数:
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;
-
reload
void reload(ResourceManager manager)
Performs the reload in the apply executor, or the game engine.- 参数:
manager- the resource manager- Mappings:
Namespace Name Mixin selector official aLadm;a(Ladl;)Vintermediary method_14491Lnet/minecraft/class_4013;method_14491(Lnet/minecraft/class_3300;)Vnamed reloadLnet/minecraft/resource/SynchronousResourceReloader;reload(Lnet/minecraft/resource/ResourceManager;)V
-
-