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 interface
ResourceReloader.Factory<S>
-
Field Summary
Fields Modifier and Type Field Description private int
appliedCount
private int
applyingCount
protected CompletableFuture<List<S>>
applyStageFuture
private int
listenerCount
protected ResourceManager
manager
private AtomicInteger
preparedCount
protected CompletableFuture<Unit>
prepareStageFuture
private AtomicInteger
preparingCount
private Set<ResourceReloadListener>
waitingListeners
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResourceReloader(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)
float
getProgress()
boolean
isApplyStageComplete()
boolean
isPrepareStageComplete()
void
throwExceptions()
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:
whenComplete
in interfaceResourceReloadMonitor
-
getProgress
@Environment(CLIENT) public float getProgress()- Specified by:
getProgress
in interfaceResourceReloadMonitor
-
isPrepareStageComplete
@Environment(CLIENT) public boolean isPrepareStageComplete()- Specified by:
isPrepareStageComplete
in interfaceResourceReloadMonitor
-
isApplyStageComplete
@Environment(CLIENT) public boolean isApplyStageComplete()- Specified by:
isApplyStageComplete
in interfaceResourceReloadMonitor
-
throwExceptions
@Environment(CLIENT) public void throwExceptions()- Specified by:
throwExceptions
in interfaceResourceReloadMonitor
-