类 SinglePreparationResourceReloader<T>
- java.lang.Object
-
- net.minecraft.resource.SinglePreparationResourceReloader<T>
-
- 类型参数:
T- the intermediate object type
- 所有已实现的接口:
ResourceReloader
- 直接已知子类:
BakedModelManager,FoliageColormapResourceSupplier,GrassColormapResourceSupplier,JsonDataLoader,SoundManager,SplashTextResourceSupplier,SpriteAtlasHolder,VideoWarningManager
public abstract class SinglePreparationResourceReloader<T> extends Object implements ResourceReloader
A base resource reloader implementation that prepares an object in a single call (as opposed to in multiple concurrent tasks) and handles the prepared object in the apply stage.- Mappings:
Namespace Name official adpintermediary net/minecraft/class_4080named net/minecraft/resource/SinglePreparationResourceReloader
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 net.minecraft.resource.ResourceReloader
ResourceReloader.Synchronizer
-
-
构造器概要
构造器 构造器 说明 SinglePreparationResourceReloader()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract voidapply(T prepared, ResourceManager manager, Profiler profiler)Handles the prepared intermediate object.protected abstract Tprepare(ResourceManager manager, Profiler profiler)Prepares the intermediate object.CompletableFuture<Void>reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor)Performs a reload.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 net.minecraft.resource.ResourceReloader
getName
-
-
-
-
方法详细资料
-
reload
public final 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;
-
prepare
protected abstract T prepare(ResourceManager manager, Profiler profiler)
Prepares the intermediate object.This method is called in the prepare executor in a reload.
- 参数:
manager- the resource managerprofiler- the prepare profiler- 返回:
- the prepared object
- Mappings:
Namespace Name Mixin selector official bLadp;b(Ladl;Lapl;)Ljava/lang/Object;intermediary method_18789Lnet/minecraft/class_4080;method_18789(Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)Ljava/lang/Object;named prepareLnet/minecraft/resource/SinglePreparationResourceReloader;prepare(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)Ljava/lang/Object;
-
apply
protected abstract void apply(T prepared, ResourceManager manager, Profiler profiler)
Handles the prepared intermediate object.This method is called in the apply executor, or the game engine, in a reload.
- 参数:
prepared- the prepared objectmanager- the resource managerprofiler- the apply profiler- Mappings:
Namespace Name Mixin selector official aLadp;a(Ljava/lang/Object;Ladl;Lapl;)Vintermediary method_18788Lnet/minecraft/class_4080;method_18788(Ljava/lang/Object;Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)Vnamed applyLnet/minecraft/resource/SinglePreparationResourceReloader;apply(Ljava/lang/Object;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V
-
-