mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 04:09:51 +00:00
Rollback registries to vanilla state if something happens during loading, so subsequent activities can still run and not generate false reports..
Signed-off-by: cpw <[email protected]>
This commit is contained in:
5 files changed
+47
-18
No files matched your search
@@ -52,7 +52,7 @@ public enum ModLoadingStage
|
||||
VALIDATE(),
|
||||
CONSTRUCT(FMLConstructModEvent.class),
|
||||
CREATE_REGISTRIES(()->Stream.of(EventGenerator.fromFunction(RegistryEvent.NewRegistry::new))),
|
||||
LOAD_REGISTRIES(GameData::generateRegistryEvents, GameData::preRegistryEventDispatch, GameData::postRegistryEventDispatch),
|
||||
LOAD_REGISTRIES(GameData::generateRegistryEvents, GameData::preRegistryEventDispatch, GameData::postRegistryEventDispatch, GameData::checkForRevertToVanilla),
|
||||
COMMON_SETUP(FMLCommonSetupEvent.class),
|
||||
SIDED_SETUP(DistExecutor.unsafeRunForDist(()->()->FMLClientSetupEvent.class, ()->()->FMLDedicatedServerSetupEvent.class)),
|
||||
ENQUEUE_IMC(InterModEnqueueEvent.class),
|
||||
@@ -83,16 +83,16 @@ public enum ModLoadingStage
|
||||
}
|
||||
|
||||
ModLoadingStage(Supplier<Stream<EventGenerator<?>>> eventStream) {
|
||||
this(eventStream, (t,f)->CompletableFuture.completedFuture(Collections.emptyList()), (t,f)->CompletableFuture.completedFuture(Collections.emptyList()));
|
||||
this(eventStream, (t,f)->CompletableFuture.completedFuture(Collections.emptyList()), (t,f)->CompletableFuture.completedFuture(Collections.emptyList()), (e, prev) ->prev.thenApplyAsync(Function.identity(), e));
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
<T extends Event & IModBusEvent> ModLoadingStage(Supplier<Stream<EventGenerator<?>>> eventStream, final BiFunction<Executor, ? extends EventGenerator<T>, CompletableFuture<List<Throwable>>> preDispatchHook, final BiFunction<Executor, ? extends EventGenerator<T>, CompletableFuture<List<Throwable>>> postDispatchHook) {
|
||||
|
||||
<T extends Event & IModBusEvent> ModLoadingStage(Supplier<Stream<EventGenerator<?>>> eventStream, final BiFunction<Executor, ? extends EventGenerator<T>, CompletableFuture<List<Throwable>>> preDispatchHook, final BiFunction<Executor, ? extends EventGenerator<T>, CompletableFuture<List<Throwable>>> postDispatchHook, final BiFunction<Executor, CompletableFuture<List<Throwable>>, CompletableFuture<List<Throwable>>> finalActivityGenerator) {
|
||||
this.eventFunctionStream = eventStream;
|
||||
this.parallelEventClass = Optional.empty();
|
||||
this.threadSelector = ThreadSelector.SYNC;
|
||||
this.preDispatchHook = preDispatchHook;
|
||||
this.postDispatchHook = postDispatchHook;
|
||||
this.finalActivityGenerator = (e, prev) ->prev.thenApplyAsync(Function.identity(), e);
|
||||
this.finalActivityGenerator = finalActivityGenerator;
|
||||
}
|
||||
|
||||
ModLoadingStage() {
|
||||
|
||||
Reference in new issue
Block a user