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/SimpleResourceReload
intermediary net/minecraft/class_4014
official avu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A factory that creates a completable future for each reloader in the resource reload. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicInteger
private @Nullable CompletableFuture
<List<S>> private static final int
The weight of either prepare or apply stages' progress in the total progress calculation.private final AtomicInteger
(package private) final CompletableFuture
<Unit> private static final int
The weight of reloaders' progress in the total progress calculation.private final int
private static final int
The weight of either prepare or apply stages' progress in the total progress calculation.private final AtomicInteger
private final AtomicInteger
(package private) final Set
<ResourceReloader> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleResourceReload
(List<ResourceReloader> waitingReloaders) -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceReload
create
(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) Creates a simple resource reload without additional results.private ResourceReloader.Synchronizer
createSynchronizer
(ResourceReloader reloader, CompletableFuture<?> future, Executor applyExecutor) float
Returns a fraction between 0 and 1 indicating the progress of this reload.protected void
start
(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloader> reloaders, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> initialStage) 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 themanager
supplied to thereloaders
.protected CompletableFuture
<List<S>> startAsync
(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloader> reloaders, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> initialStage) private static int
toWeighted
(int prepare, int apply, int total) Returns a future for the reload.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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_WEIGHT
Lnet/minecraft/resource/SimpleResourceReload;FIRST_PREPARE_APPLY_WEIGHT:I
intermediary field_29784
Lnet/minecraft/class_4014;field_29784:I
official a
Lavu;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_WEIGHT
Lnet/minecraft/resource/SimpleResourceReload;SECOND_PREPARE_APPLY_WEIGHT:I
intermediary field_29785
Lnet/minecraft/class_4014;field_29785:I
official b
Lavu;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_WEIGHT
Lnet/minecraft/resource/SimpleResourceReload;RELOADER_WEIGHT:I
intermediary field_29786
Lnet/minecraft/class_4014;field_29786:I
official c
Lavu;c:I
-
prepareStageFuture
- Mappings:
Namespace Name Mixin selector named prepareStageFuture
Lnet/minecraft/resource/SimpleResourceReload;prepareStageFuture:Ljava/util/concurrent/CompletableFuture;
intermediary field_18042
Lnet/minecraft/class_4014;field_18042:Ljava/util/concurrent/CompletableFuture;
official d
Lavu;d:Ljava/util/concurrent/CompletableFuture;
-
applyStageFuture
- Mappings:
Namespace Name Mixin selector named applyStageFuture
Lnet/minecraft/resource/SimpleResourceReload;applyStageFuture:Ljava/util/concurrent/CompletableFuture;
intermediary field_18043
Lnet/minecraft/class_4014;field_18043:Ljava/util/concurrent/CompletableFuture;
official e
Lavu;e:Ljava/util/concurrent/CompletableFuture;
-
waitingReloaders
- Mappings:
Namespace Name Mixin selector named waitingReloaders
Lnet/minecraft/resource/SimpleResourceReload;waitingReloaders:Ljava/util/Set;
intermediary field_18044
Lnet/minecraft/class_4014;field_18044:Ljava/util/Set;
official f
Lavu;f:Ljava/util/Set;
-
reloaderCount
private final int reloaderCount- Mappings:
Namespace Name Mixin selector named reloaderCount
Lnet/minecraft/resource/SimpleResourceReload;reloaderCount:I
intermediary field_18045
Lnet/minecraft/class_4014;field_18045:I
official g
Lavu;g:I
-
toPrepareCount
- Mappings:
Namespace Name Mixin selector named toPrepareCount
Lnet/minecraft/resource/SimpleResourceReload;toPrepareCount:Ljava/util/concurrent/atomic/AtomicInteger;
intermediary field_18048
Lnet/minecraft/class_4014;field_18048:Ljava/util/concurrent/atomic/AtomicInteger;
official h
Lavu;h:Ljava/util/concurrent/atomic/AtomicInteger;
-
preparedCount
- Mappings:
Namespace Name Mixin selector named preparedCount
Lnet/minecraft/resource/SimpleResourceReload;preparedCount:Ljava/util/concurrent/atomic/AtomicInteger;
intermediary field_56609
Lnet/minecraft/class_4014;field_56609:Ljava/util/concurrent/atomic/AtomicInteger;
official i
Lavu;i:Ljava/util/concurrent/atomic/AtomicInteger;
-
toApplyCount
- Mappings:
Namespace Name Mixin selector named toApplyCount
Lnet/minecraft/resource/SimpleResourceReload;toApplyCount:Ljava/util/concurrent/atomic/AtomicInteger;
intermediary field_18046
Lnet/minecraft/class_4014;field_18046:Ljava/util/concurrent/atomic/AtomicInteger;
official j
Lavu;j:Ljava/util/concurrent/atomic/AtomicInteger;
-
appliedCount
- Mappings:
Namespace Name Mixin selector named appliedCount
Lnet/minecraft/resource/SimpleResourceReload;appliedCount:Ljava/util/concurrent/atomic/AtomicInteger;
intermediary field_18047
Lnet/minecraft/class_4014;field_18047:Ljava/util/concurrent/atomic/AtomicInteger;
official k
Lavu;k:Ljava/util/concurrent/atomic/AtomicInteger;
-
-
Constructor Details
-
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 create
Lnet/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_18369
Lnet/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 b
Lavu;b(Lavo;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Lavk;
-
start
protected void start(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloader> reloaders, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> initialStage) - Mappings:
Namespace Name Mixin selector named start
Lnet/minecraft/resource/SimpleResourceReload;start(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
intermediary method_67578
Lnet/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;)V
official b
Lavu;b(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lavo;Ljava/util/List;Lavu$a;Ljava/util/concurrent/CompletableFuture;)V
-
startAsync
protected CompletableFuture<List<S>> startAsync(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloader> reloaders, SimpleResourceReload.Factory<S> factory, CompletableFuture<?> initialStage) - Mappings:
Namespace Name Mixin selector named startAsync
Lnet/minecraft/resource/SimpleResourceReload;startAsync(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_67571
Lnet/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 a
Lavu;a(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lavo;Ljava/util/List;Lavu$a;Ljava/util/concurrent/CompletableFuture;)Ljava/util/concurrent/CompletableFuture;
-
createSynchronizer
private ResourceReloader.Synchronizer createSynchronizer(ResourceReloader reloader, CompletableFuture<?> future, Executor applyExecutor) - Mappings:
Namespace Name Mixin selector named createSynchronizer
Lnet/minecraft/resource/SimpleResourceReload;createSynchronizer(Lnet/minecraft/resource/ResourceReloader;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/Executor;)Lnet/minecraft/resource/ResourceReloader$Synchronizer;
intermediary method_67573
Lnet/minecraft/class_4014;method_67573(Lnet/minecraft/class_3302;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/Executor;)Lnet/minecraft/class_3302$class_4045;
official a
Lavu;a(Lavi;Ljava/util/concurrent/CompletableFuture;Ljava/util/concurrent/Executor;)Lavi$a;
-
whenComplete
Returns a future for the reload. The returned future is completed when the reload completes.- Specified by:
whenComplete
in interfaceResourceReload
- Mappings:
Namespace Name Mixin selector named whenComplete
Lnet/minecraft/resource/ResourceReload;whenComplete()Ljava/util/concurrent/CompletableFuture;
intermediary method_18364
Lnet/minecraft/class_4011;method_18364()Ljava/util/concurrent/CompletableFuture;
official a
Lavk;a()Ljava/util/concurrent/CompletableFuture;
-
getProgress
public float getProgress()Returns a fraction between 0 and 1 indicating the progress of this reload.- Specified by:
getProgress
in interfaceResourceReload
- Mappings:
Namespace Name Mixin selector named getProgress
Lnet/minecraft/resource/ResourceReload;getProgress()F
intermediary method_18229
Lnet/minecraft/class_4011;method_18229()F
official b
Lavk;b()F
-
toWeighted
private static int toWeighted(int prepare, int apply, int total) - Mappings:
Namespace Name Mixin selector named toWeighted
Lnet/minecraft/resource/SimpleResourceReload;toWeighted(III)I
intermediary method_67572
Lnet/minecraft/class_4014;method_67572(III)I
official a
Lavu;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 themanager
supplied 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
ReloadableResourceManagerImpl
on the client andDataPackContents
on the server. - Mappings:
Namespace Name Mixin selector named start
Lnet/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_40087
Lnet/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 a
Lavu;a(Lavo;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Z)Lavk;
-