Package net.minecraft.resource
Class ResourceReloader<S>
java.lang.Object
net.minecraft.resource.ResourceReloader<S>
- All Implemented Interfaces:
ResourceReloadMonitor
- Direct Known Subclasses:
ProfilingResourceReloader
public class ResourceReloader<S> extends Object implements ResourceReloadMonitor
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceResourceReloader.Factory<S> -
Field Summary
Fields Modifier and Type Field Description private intappliedCountprivate intapplyingCountprotected CompletableFuture<List<S>>applyStageFutureprivate intlistenerCountprotected ResourceManagermanagerprivate AtomicIntegerpreparedCountprotected CompletableFuture<Unit>prepareStageFutureprivate AtomicIntegerpreparingCountprivate Set<ResourceReloadListener>waitingListeners -
Constructor Summary
Constructors Modifier Constructor Description protectedResourceReloader(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloadListener> listeners, ResourceReloader.Factory<S> creator, CompletableFuture<Unit> initialStage) -
Method Summary
Modifier and Type Method Description static ResourceReloader<Void>create(ResourceManager manager, List<ResourceReloadListener> listeners, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage)floatgetProgress()booleanisApplyStageComplete()booleanisPrepareStageComplete()voidthrowExceptions()CompletableFuture<Unit>whenComplete()
-
Field Details
-
manager
-
prepareStageFuture
-
applyStageFuture
-
waitingListeners
-
listenerCount
private final int listenerCount -
applyingCount
private int applyingCount -
appliedCount
private int appliedCount -
preparingCount
-
preparedCount
-
-
Constructor Details
-
ResourceReloader
protected ResourceReloader(Executor prepareExecutor, Executor applyExecutor, ResourceManager manager, List<ResourceReloadListener> listeners, ResourceReloader.Factory<S> creator, CompletableFuture<Unit> initialStage)
-
-
Method Details
-
create
public static ResourceReloader<Void> create(ResourceManager manager, List<ResourceReloadListener> listeners, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) -
whenComplete
- Specified by:
whenCompletein interfaceResourceReloadMonitor
-
getProgress
@Environment(CLIENT) public float getProgress()- Specified by:
getProgressin interfaceResourceReloadMonitor
-
isPrepareStageComplete
@Environment(CLIENT) public boolean isPrepareStageComplete()- Specified by:
isPrepareStageCompletein interfaceResourceReloadMonitor
-
isApplyStageComplete
@Environment(CLIENT) public boolean isApplyStageComplete()- Specified by:
isApplyStageCompletein interfaceResourceReloadMonitor
-
throwExceptions
@Environment(CLIENT) public void throwExceptions()- Specified by:
throwExceptionsin interfaceResourceReloadMonitor
-