Class SimpleReloadInstance<S>
java.lang.Object
net.minecraft.server.packs.resources.SimpleReloadInstance<S>
- All Implemented Interfaces:
ReloadInstance
- Direct Known Subclasses:
ProfiledReloadInstance
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable CompletableFuture<List<S>> private final CompletableFuture<Unit> private static final intprivate final AtomicIntegerprivate final AtomicIntegerprivate static final intprivate final intprivate static final intprivate final Set<PreparableReloadListener> private final AtomicIntegerprivate final AtomicInteger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleReloadInstance(List<PreparableReloadListener> listeners) -
Method Summary
Modifier and TypeMethodDescriptionstatic ReloadInstancecreate(ResourceManager resourceManager, List<PreparableReloadListener> listeners, Executor backgroundExecutor, Executor mainThreadExecutor, CompletableFuture<Unit> initialTask, boolean enableProfiling) createBarrierForListener(PreparableReloadListener listener, CompletableFuture<?> previousBarrier, Executor mainThreadExecutor) done()floatstatic ReloadInstanceof(ResourceManager resourceManager, List<PreparableReloadListener> listeners, Executor taskExecutor, Executor mainThreadExecutor, CompletableFuture<Unit> initialTask) protected CompletableFuture<List<S>> prepareTasks(Executor taskExecutor, Executor mainThreadExecutor, ResourceManager resourceManager, List<PreparableReloadListener> listeners, SimpleReloadInstance.StateFactory<S> stateFactory, CompletableFuture<?> initialTask) protected voidstartTasks(Executor taskExecutor, Executor mainThreadExecutor, ResourceManager resourceManager, List<PreparableReloadListener> listeners, SimpleReloadInstance.StateFactory<S> stateFactory, CompletableFuture<?> initialTask) private static intweightProgress(int preparationTasks, int reloadTasks, int listeners) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReloadInstance
checkExceptions, isDone
-
Field Details
-
PREPARATION_PROGRESS_WEIGHT
private static final int PREPARATION_PROGRESS_WEIGHT- See Also:
-
EXTRA_RELOAD_PROGRESS_WEIGHT
private static final int EXTRA_RELOAD_PROGRESS_WEIGHT- See Also:
-
LISTENER_PROGRESS_WEIGHT
private static final int LISTENER_PROGRESS_WEIGHT- See Also:
-
allPreparations
-
allDone
-
preparingListeners
-
listenerCount
private final int listenerCount -
startedTasks
-
finishedTasks
-
startedReloads
-
finishedReloads
-
-
Constructor Details
-
SimpleReloadInstance
-
-
Method Details
-
of
public static ReloadInstance of(ResourceManager resourceManager, List<PreparableReloadListener> listeners, Executor taskExecutor, Executor mainThreadExecutor, CompletableFuture<Unit> initialTask) -
startTasks
protected void startTasks(Executor taskExecutor, Executor mainThreadExecutor, ResourceManager resourceManager, List<PreparableReloadListener> listeners, SimpleReloadInstance.StateFactory<S> stateFactory, CompletableFuture<?> initialTask) -
prepareTasks
protected CompletableFuture<List<S>> prepareTasks(Executor taskExecutor, Executor mainThreadExecutor, ResourceManager resourceManager, List<PreparableReloadListener> listeners, SimpleReloadInstance.StateFactory<S> stateFactory, CompletableFuture<?> initialTask) -
createBarrierForListener
private PreparableReloadListener.PreparationBarrier createBarrierForListener(PreparableReloadListener listener, CompletableFuture<?> previousBarrier, Executor mainThreadExecutor) -
done
- Specified by:
donein interfaceReloadInstance
-
getActualProgress
public float getActualProgress()- Specified by:
getActualProgressin interfaceReloadInstance
-
weightProgress
private static int weightProgress(int preparationTasks, int reloadTasks, int listeners) -
create
public static ReloadInstance create(ResourceManager resourceManager, List<PreparableReloadListener> listeners, Executor backgroundExecutor, Executor mainThreadExecutor, CompletableFuture<Unit> initialTask, boolean enableProfiling)
-