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 int
private final AtomicInteger
private final AtomicInteger
private static final int
private final int
private static final int
(package private) final Set
<PreparableReloadListener> private final AtomicInteger
private final AtomicInteger
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleReloadInstance
(List<PreparableReloadListener> pPreparingListeners) -
Method Summary
Modifier and TypeMethodDescriptionstatic ReloadInstance
create
(ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, Executor pBackgroundExecutor, Executor pGameExecutor, CompletableFuture<Unit> pAlsoWaitedFor, boolean pProfiled) createBarrierForListener
(PreparableReloadListener pListener, CompletableFuture<?> pAlsoWaitedFor, Executor pExecutor) done()
float
static ReloadInstance
of
(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 void
startTasks
(Executor pBackgroundExecutor, Executor pGameExecutor, ResourceManager pResourceManager, List<PreparableReloadListener> pListeners, SimpleReloadInstance.StateFactory<S> pStateFactory, CompletableFuture<?> pAlsoWaitedFor) private static int
weightProgress
(int pTasks, int pReloads, int pListeners) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
done
in interfaceReloadInstance
-
getActualProgress
public float getActualProgress()- Specified by:
getActualProgress
in 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)
-