Package net.minecraft.resource
Class SimpleResourceReload<S>
java.lang.Object
net.minecraft.resource.SimpleResourceReload<S>
- Type Parameters:
S- the result type for each reloader in the reload
- All Implemented Interfaces:
ResourceReload
- Direct Known Subclasses:
ProfiledResourceReload
A simple implementation of resource reload.
- Mappings:
Namespace Name named net/minecraft/resource/SimpleResourceReloadintermediary net/minecraft/class_4014official avj
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceA factory that creates a completable future for each reloader in the resource reload. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicIntegerprivate @Nullable CompletableFuture<List<S>> private final AtomicIntegerprivate static final intThe weight of either prepare or apply stages' progress in the total progress calculation.(package private) final CompletableFuture<Unit> private static final intThe weight of reloaders' progress in the total progress calculation.private final intprivate static final intThe weight of either prepare or apply stages' progress in the total progress calculation.private final AtomicIntegerprivate final AtomicInteger(package private) final Set<ResourceReloader> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceReloadcreate(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) Creates a simple resource reload without additional results.floatReturns a fraction between 0 and 1 indicating the progress of this reload.protected CompletableFuture<List<S>> method_67571(Executor executor, Executor executor2, ResourceManager resourceManager, List<ResourceReloader> list, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> completableFuture) private static intmethod_67572(int int2, int int3, int int4) private ResourceReloader.Synchronizermethod_67573(ResourceReloader resourceReloader, CompletableFuture<?> completableFuture, Executor executor) protected voidmethod_67578(Executor executor, Executor executor2, ResourceManager resourceManager, List<ResourceReloader> list, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> completableFuture) static ResourceReloadstart(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage, boolean profiled) Starts a resource reload with the content from themanagersupplied to thereloaders.Returns a future for the reload.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.ResourceReload
isComplete, throwException
-
Field Details
-
FIRST_PREPARE_APPLY_WEIGHT
private static final int FIRST_PREPARE_APPLY_WEIGHTThe weight of either prepare or apply stages' progress in the total progress calculation. Has value 2.- See Also:
- Mappings:
Namespace Name Mixin selector named FIRST_PREPARE_APPLY_WEIGHTLnet/minecraft/resource/SimpleResourceReload;FIRST_PREPARE_APPLY_WEIGHT:Iintermediary field_29784Lnet/minecraft/class_4014;field_29784:Iofficial aLavj;a:I
-
SECOND_PREPARE_APPLY_WEIGHT
private static final int SECOND_PREPARE_APPLY_WEIGHTThe weight of either prepare or apply stages' progress in the total progress calculation. Has value 2.- See Also:
- Mappings:
Namespace Name Mixin selector named SECOND_PREPARE_APPLY_WEIGHTLnet/minecraft/resource/SimpleResourceReload;SECOND_PREPARE_APPLY_WEIGHT:Iintermediary field_29785Lnet/minecraft/class_4014;field_29785:Iofficial bLavj;b:I
-
RELOADER_WEIGHT
private static final int RELOADER_WEIGHTThe weight of reloaders' progress in the total progress calculation. Has value 1.- See Also:
- Mappings:
Namespace Name Mixin selector named RELOADER_WEIGHTLnet/minecraft/resource/SimpleResourceReload;RELOADER_WEIGHT:Iintermediary field_29786Lnet/minecraft/class_4014;field_29786:Iofficial cLavj;c:I
-
prepareStageFuture
- Mappings:
Namespace Name Mixin selector named prepareStageFutureLnet/minecraft/resource/SimpleResourceReload;prepareStageFuture:Ljava/util/concurrent/CompletableFuture;intermediary field_18042Lnet/minecraft/class_4014;field_18042:Ljava/util/concurrent/CompletableFuture;official dLavj;d:Ljava/util/concurrent/CompletableFuture;
-
applyStageFuture
- Mappings:
Namespace Name Mixin selector named applyStageFutureLnet/minecraft/resource/SimpleResourceReload;applyStageFuture:Ljava/util/concurrent/CompletableFuture;intermediary field_18043Lnet/minecraft/class_4014;field_18043:Ljava/util/concurrent/CompletableFuture;official eLavj;e:Ljava/util/concurrent/CompletableFuture;
-
waitingReloaders
- Mappings:
Namespace Name Mixin selector named waitingReloadersLnet/minecraft/resource/SimpleResourceReload;waitingReloaders:Ljava/util/Set;intermediary field_18044Lnet/minecraft/class_4014;field_18044:Ljava/util/Set;official fLavj;f:Ljava/util/Set;
-
reloaderCount
private final int reloaderCount- Mappings:
Namespace Name Mixin selector named reloaderCountLnet/minecraft/resource/SimpleResourceReload;reloaderCount:Iintermediary field_18045Lnet/minecraft/class_4014;field_18045:Iofficial gLavj;g:I
-
toPrepareCount
- Mappings:
Namespace Name Mixin selector named toPrepareCountLnet/minecraft/resource/SimpleResourceReload;toPrepareCount:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_18048Lnet/minecraft/class_4014;field_18048:Ljava/util/concurrent/atomic/AtomicInteger;official hLavj;h:Ljava/util/concurrent/atomic/AtomicInteger;
-
field_56609
- Mappings:
Namespace Name Mixin selector named field_56609Lnet/minecraft/resource/SimpleResourceReload;field_56609:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_56609Lnet/minecraft/class_4014;field_56609:Ljava/util/concurrent/atomic/AtomicInteger;official iLavj;i:Ljava/util/concurrent/atomic/AtomicInteger;
-
toApplyCount
- Mappings:
Namespace Name Mixin selector named toApplyCountLnet/minecraft/resource/SimpleResourceReload;toApplyCount:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_18046Lnet/minecraft/class_4014;field_18046:Ljava/util/concurrent/atomic/AtomicInteger;official jLavj;j:Ljava/util/concurrent/atomic/AtomicInteger;
-
appliedCount
- Mappings:
Namespace Name Mixin selector named appliedCountLnet/minecraft/resource/SimpleResourceReload;appliedCount:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_18047Lnet/minecraft/class_4014;field_18047:Ljava/util/concurrent/atomic/AtomicInteger;official kLavj;k:Ljava/util/concurrent/atomic/AtomicInteger;
-
-
Constructor Details
-
SimpleResourceReload
-
-
Method Details
-
create
public static ResourceReload create(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) Creates a simple resource reload without additional results.- Mappings:
Namespace Name Mixin selector named createLnet/minecraft/resource/SimpleResourceReload;create(Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Lnet/minecraft/resource/ResourceReload;intermediary method_18369Lnet/minecraft/class_4014;method_18369(Lnet/minecraft/class_3300;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Lnet/minecraft/class_4011;official bLavj;b(Lavd;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Lauz;
-
method_67578
protected void method_67578(Executor executor, Executor executor2, ResourceManager resourceManager, List<ResourceReloader> list, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> completableFuture) - Mappings:
Namespace Name Mixin selector named method_67578Lnet/minecraft/resource/SimpleResourceReload;method_67578(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Lnet/minecraft/resource/SimpleResourceReload$Factory;Ljava/util/concurrent/CompletableFuture;)Vintermediary method_67578Lnet/minecraft/class_4014;method_67578(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lnet/minecraft/class_3300;Ljava/util/List;Lnet/minecraft/class_4014$class_4047;Ljava/util/concurrent/CompletableFuture;)Vofficial bLavj;b(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lavd;Ljava/util/List;Lavj$a;Ljava/util/concurrent/CompletableFuture;)V
-
method_67571
protected CompletableFuture<List<S>> method_67571(Executor executor, Executor executor2, ResourceManager resourceManager, List<ResourceReloader> list, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> completableFuture) - Mappings:
Namespace Name Mixin selector named method_67571Lnet/minecraft/resource/SimpleResourceReload;method_67571(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Lnet/minecraft/resource/SimpleResourceReload$Factory;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;intermediary method_67571Lnet/minecraft/class_4014;method_67571(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lnet/minecraft/class_3300;Ljava/util/List;Lnet/minecraft/class_4014$class_4047;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;official aLavj;a(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lavd;Ljava/util/List;Lavj$a;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;
-
method_67573
private ResourceReloader.Synchronizer method_67573(ResourceReloader resourceReloader, CompletableFuture<?> completableFuture, Executor executor) - Mappings:
Namespace Name Mixin selector named method_67573Lnet/minecraft/resource/SimpleResourceReload;method_67573(Lnet/minecraft/resource/ResourceReloader;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/Executor;)Lnet/minecraft/resource/ResourceReloader$Synchronizer;intermediary method_67573Lnet/minecraft/class_4014;method_67573(Lnet/minecraft/class_3302;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/Executor;)Lnet/minecraft/class_3302$class_4045;official aLavj;a(Lauw;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/Executor;)Lauw$a;
-
whenComplete
Returns a future for the reload. The returned future is completed when the reload completes.- Specified by:
whenCompletein interfaceResourceReload- Mappings:
Namespace Name Mixin selector named whenCompleteLnet/minecraft/resource/ResourceReload;whenComplete()Ljava/util/concurrent/CompletableFuture;intermediary method_18364Lnet/minecraft/class_4011;method_18364()Ljava/util/concurrent/CompletableFuture;official aLauz;a()Ljava/util/concurrent/CompletableFuture;
-
getProgress
public float getProgress()Returns a fraction between 0 and 1 indicating the progress of this reload.- Specified by:
getProgressin interfaceResourceReload- Mappings:
Namespace Name Mixin selector named getProgressLnet/minecraft/resource/ResourceReload;getProgress()Fintermediary method_18229Lnet/minecraft/class_4011;method_18229()Fofficial bLauz;b()F
-
method_67572
private static int method_67572(int int2, int int3, int int4) - Mappings:
Namespace Name Mixin selector named method_67572Lnet/minecraft/resource/SimpleResourceReload;method_67572(III)Iintermediary method_67572Lnet/minecraft/class_4014;method_67572(III)Iofficial aLavj;a(III)I
-
start
public static ResourceReload start(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage, boolean profiled) Starts a resource reload with the content from themanagersupplied to thereloaders.- Parameters:
manager- the resource manager, providing resources to the reloadersreloaders- the reloaders performing the reloadprepareExecutor- the executor for the prepare stage, often asynchronousapplyExecutor- the executor for the apply stage, synchronous with the game engineinitialStage- the initial stage, must be completed before the reloaders can prepare resourcesprofiled- whether to profile this reload and log the statistics- API Note:
- In vanilla, this is respectively called by
ReloadableResourceManagerImplon the client andDataPackContentson the server. - Mappings:
Namespace Name Mixin selector named startLnet/minecraft/resource/SimpleResourceReload;start(Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Z)Lnet/minecraft/resource/ResourceReload;intermediary method_40087Lnet/minecraft/class_4014;method_40087(Lnet/minecraft/class_3300;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Z)Lnet/minecraft/class_4011;official aLavj;a(Lavd;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Z)Lauz;
-