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
public class SimpleResourceReload<S> extends Object implements ResourceReload
A simple implementation of resource reload.
- Mappings:
Namespace Name official admintermediary net/minecraft/class_4014named net/minecraft/resource/SimpleResourceReload
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSimpleResourceReload.Factory<S>A factory that creates a completable future for each reloader in the resource reload. -
Field Summary
Fields Modifier and Type Field Description private intappliedCountprotected CompletableFuture<List<S>>applyStageFutureprotected ResourceManagermanagerprivate AtomicIntegerpreparedCountprotected CompletableFuture<Unit>prepareStageFutureprivate intreloaderCountprivate inttoApplyCountprivate AtomicIntegertoPrepareCountprivate Set<ResourceReloader>waitingReloaders -
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleResourceReload(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloader> reloaders, SimpleResourceReload.Factory<S> factory, CompletableFuture<Unit> initialStage) -
Method Summary
Modifier and Type Method Description static SimpleResourceReload<Void>create(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage)Creates a simple resource reload without additional results.floatgetProgress()Returns a fraction between 0 and 1 indicating the progress of this reload.booleanisComplete()Returns if this reload has completed, either normally or abnormally.voidthrowException()Throws an unchecked exception from this reload, if there is any.CompletableFuture<Unit>whenComplete()Returns a future for the reload.
-
Field Details
-
manager
- Mappings:
Namespace Name Mixin selector official aLadm;a:Ladh;intermediary field_17927Lnet/minecraft/class_4014;field_17927:Lnet/minecraft/class_3300;named managerLnet/minecraft/resource/SimpleResourceReload;manager:Lnet/minecraft/resource/ResourceManager;
-
prepareStageFuture
- Mappings:
Namespace Name Mixin selector official bLadm;b:Ljava/util/concurrent/CompletableFuture;intermediary field_18042Lnet/minecraft/class_4014;field_18042:Ljava/util/concurrent/CompletableFuture;named prepareStageFutureLnet/minecraft/resource/SimpleResourceReload;prepareStageFuture:Ljava/util/concurrent/CompletableFuture;
-
applyStageFuture
- Mappings:
Namespace Name Mixin selector official cLadm;c:Ljava/util/concurrent/CompletableFuture;intermediary field_18043Lnet/minecraft/class_4014;field_18043:Ljava/util/concurrent/CompletableFuture;named applyStageFutureLnet/minecraft/resource/SimpleResourceReload;applyStageFuture:Ljava/util/concurrent/CompletableFuture;
-
waitingReloaders
- Mappings:
Namespace Name Mixin selector official dLadm;d:Ljava/util/Set;intermediary field_18044Lnet/minecraft/class_4014;field_18044:Ljava/util/Set;named waitingReloadersLnet/minecraft/resource/SimpleResourceReload;waitingReloaders:Ljava/util/Set;
-
reloaderCount
private final int reloaderCount- Mappings:
Namespace Name Mixin selector official eLadm;e:Iintermediary field_18045Lnet/minecraft/class_4014;field_18045:Inamed reloaderCountLnet/minecraft/resource/SimpleResourceReload;reloaderCount:I
-
toApplyCount
private int toApplyCount- Mappings:
Namespace Name Mixin selector official fLadm;f:Iintermediary field_18046Lnet/minecraft/class_4014;field_18046:Inamed toApplyCountLnet/minecraft/resource/SimpleResourceReload;toApplyCount:I
-
appliedCount
private int appliedCount- Mappings:
Namespace Name Mixin selector official gLadm;g:Iintermediary field_18047Lnet/minecraft/class_4014;field_18047:Inamed appliedCountLnet/minecraft/resource/SimpleResourceReload;appliedCount:I
-
toPrepareCount
- Mappings:
Namespace Name Mixin selector official hLadm;h:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_18048Lnet/minecraft/class_4014;field_18048:Ljava/util/concurrent/atomic/AtomicInteger;named toPrepareCountLnet/minecraft/resource/SimpleResourceReload;toPrepareCount:Ljava/util/concurrent/atomic/AtomicInteger;
-
preparedCount
- Mappings:
Namespace Name Mixin selector official iLadm;i:Ljava/util/concurrent/atomic/AtomicInteger;intermediary field_18049Lnet/minecraft/class_4014;field_18049:Ljava/util/concurrent/atomic/AtomicInteger;named preparedCountLnet/minecraft/resource/SimpleResourceReload;preparedCount:Ljava/util/concurrent/atomic/AtomicInteger;
-
-
Constructor Details
-
SimpleResourceReload
protected SimpleResourceReload(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloader> reloaders, SimpleResourceReload.Factory<S> factory, CompletableFuture<Unit> initialStage)- Mappings:
Namespace Name Mixin selector official <init>Ladm;<init>(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ladh;Ljava/util/List;Ladm$a;Ljava/util/concurrent/CompletableFuture;)Vintermediary <init>Lnet/minecraft/class_4014;<init>(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;)Vnamed <init>Lnet/minecraft/resource/SimpleResourceReload;<init>(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Lnet/minecraft/resource/SimpleResourceReload$Factory;Ljava/util/concurrent/CompletableFuture;)V
-
-
Method Details
-
create
public static SimpleResourceReload<Void> 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 official aLadm;a(Ladh;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Ladm;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_4014;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/SimpleResourceReload;
-
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 official aLade;a()Ljava/util/concurrent/CompletableFuture;intermediary method_18364Lnet/minecraft/class_4011;method_18364()Ljava/util/concurrent/CompletableFuture;named whenCompleteLnet/minecraft/resource/ResourceReload;whenComplete()Ljava/util/concurrent/CompletableFuture;
-
getProgress
Returns a fraction between 0 and 1 indicating the progress of this reload.- Specified by:
getProgressin interfaceResourceReload- Mappings:
Namespace Name Mixin selector official bLade;b()Fintermediary method_18229Lnet/minecraft/class_4011;method_18229()Fnamed getProgressLnet/minecraft/resource/ResourceReload;getProgress()F
-
isComplete
Returns if this reload has completed, either normally or abnormally.- Specified by:
isCompletein interfaceResourceReload- Mappings:
Namespace Name Mixin selector official cLade;c()Zintermediary method_18787Lnet/minecraft/class_4011;method_18787()Znamed isCompleteLnet/minecraft/resource/ResourceReload;isComplete()Z
-
throwException
Throws an unchecked exception from this reload, if there is any. Does nothing if the reload has not completed or terminated.- Specified by:
throwExceptionin interfaceResourceReload- Mappings:
Namespace Name Mixin selector official dLade;d()Vintermediary method_18849Lnet/minecraft/class_4011;method_18849()Vnamed throwExceptionLnet/minecraft/resource/ResourceReload;throwException()V
-