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 CompletableFuture<List<S>> (package private) final CompletableFuture<Unit> private static final intprivate final AtomicIntegerprivate final AtomicIntegerprivate static final intprivate final intprivate static final int(package private) final Set<PreparableReloadListener> private final AtomicIntegerprivate final AtomicInteger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleReloadInstance(List<PreparableReloadListener> pPreparingListeners) -
Method Summary
Modifier and TypeMethodDescriptionstatic ReloadInstancecreate(ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, Executor pBackgroundExecutor, Executor pGameExecutor, CompletableFuture<Unit> pAlsoWaitedFor, boolean pProfiled) createBarrierForListener(PreparableReloadListener pListener, CompletableFuture<?> pAlsoWaitedFor, Executor pExecutor) done()floatstatic ReloadInstanceof(ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, Executor pBackgroundExecutor, Executor pGameExecutor, CompletableFuture<Unit> pAlsoWaitedFor) protected CompletableFuture<List<S>> prepareTasks(Executor pBackgroundExecutor, Executor pGameExecutor, ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, SimpleReloadInstance.StateFactory<S> pStateFactory, CompletableFuture<?> pAlsoWaitedFor) protected voidstartTasks(Executor pBackgroundExecutor, Executor pGameExecutor, ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, SimpleReloadInstance.StateFactory<S> pStateFactory, CompletableFuture<?> pAlsoWaitedFor) private static intweightProgress(int pTasks, int pReloads, int pListeners) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.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 pResourceManager, List<PreparableReloadListener> pListeners, Executor pBackgroundExecutor, Executor pGameExecutor, CompletableFuture<Unit> pAlsoWaitedFor) -
startTasks
protected void startTasks(Executor pBackgroundExecutor, Executor pGameExecutor, ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, SimpleReloadInstance.StateFactory<S> pStateFactory, CompletableFuture<?> pAlsoWaitedFor) -
prepareTasks
protected CompletableFuture<List<S>> prepareTasks(Executor pBackgroundExecutor, Executor pGameExecutor, ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, SimpleReloadInstance.StateFactory<S> pStateFactory, CompletableFuture<?> pAlsoWaitedFor) -
createBarrierForListener
private PreparableReloadListener.PreparationBarrier createBarrierForListener(PreparableReloadListener pListener, CompletableFuture<?> pAlsoWaitedFor, Executor pExecutor) -
done
- Specified by:
donein interfaceReloadInstance
-
getActualProgress
public float getActualProgress()- Specified by:
getActualProgressin interfaceReloadInstance
-
weightProgress
private static int weightProgress(int pTasks, int pReloads, int pListeners) -
create
public static ReloadInstance create(ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, Executor pBackgroundExecutor, Executor pGameExecutor, CompletableFuture<Unit> pAlsoWaitedFor, boolean pProfiled)
-