mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Remove legacy StartupProgress.
Implement properly scalable progress thanks to @gigaherz. Closes #5863. Implement API for pushing messages to the startup screen from mods. Add memory display. Signed-off-by: cpw <[email protected]>
This commit is contained in:
26 files changed
+348
-1526
No files matched your search
@@ -41,7 +41,7 @@ public enum LifecycleEventProvider
|
||||
GATHERDATA(()->new GatherDataLifecycleEvent(ModLoadingStage.GATHERDATA), ModList.inlineDispatcher);
|
||||
|
||||
private final Supplier<? extends LifecycleEvent> event;
|
||||
private final EventHandler<LifecycleEvent, Consumer<List<ModLoadingException>>,Executor> eventDispatcher;
|
||||
private final EventHandler<LifecycleEvent, Consumer<List<ModLoadingException>>,Executor, Runnable> eventDispatcher;
|
||||
private Supplier<Event> customEventSupplier;
|
||||
private LifecycleEvent.Progression progression = LifecycleEvent.Progression.NEXT;
|
||||
|
||||
@@ -50,7 +50,7 @@ public enum LifecycleEventProvider
|
||||
this(e, ModList.parallelDispatcher);
|
||||
}
|
||||
|
||||
LifecycleEventProvider(Supplier<? extends LifecycleEvent> e, EventHandler<LifecycleEvent, Consumer<List<ModLoadingException>>,Executor> eventDispatcher)
|
||||
LifecycleEventProvider(Supplier<? extends LifecycleEvent> e, EventHandler<LifecycleEvent, Consumer<List<ModLoadingException>>,Executor, Runnable> eventDispatcher)
|
||||
{
|
||||
this.event = e;
|
||||
this.eventDispatcher = eventDispatcher;
|
||||
@@ -64,11 +64,11 @@ public enum LifecycleEventProvider
|
||||
this.progression = progression;
|
||||
}
|
||||
|
||||
public void dispatch(Consumer<List<ModLoadingException>> errorHandler, final Executor executor) {
|
||||
public void dispatch(Consumer<List<ModLoadingException>> errorHandler, final Executor executor, final Runnable ticker) {
|
||||
final LifecycleEvent lifecycleEvent = this.event.get();
|
||||
lifecycleEvent.setCustomEventSupplier(this.customEventSupplier);
|
||||
lifecycleEvent.changeProgression(this.progression);
|
||||
this.eventDispatcher.dispatchEvent(lifecycleEvent, errorHandler, executor);
|
||||
this.eventDispatcher.dispatchEvent(lifecycleEvent, errorHandler, executor, ticker);
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ public enum LifecycleEventProvider
|
||||
}
|
||||
}
|
||||
|
||||
public interface EventHandler<T extends LifecycleEvent, U extends Consumer<? extends List<? super ModLoadingException>>, V extends Executor> {
|
||||
void dispatchEvent(T event, U exceptionHandler, V executor);
|
||||
public interface EventHandler<T extends LifecycleEvent, U extends Consumer<? extends List<? super ModLoadingException>>, V extends Executor, R extends Runnable> {
|
||||
void dispatchEvent(T event, U exceptionHandler, V executor, R ticker);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user