Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------ src/main/java/net/minecraftforge/fml/ModContainer.java ------------
- index 137e4cce1..944a53ca0 100644
- @@ -164,5 +164,5 @@ public abstract class ModContainer
- * Accept an arbitrary event for processing by the mod. Probably posted to an event bus in the lower level container.
- * @param e Event to accept
- */
- - protected void acceptEvent(Event e) {}
- + public void acceptEvent(Event e) {}
- }
- ------- src/main/java/net/minecraftforge/fml/client/ClientModLoader.java -------
- index 662f18f05..f6cecb62d 100644
- @@ -60,6 +60,7 @@ import net.minecraftforge.eventbus.api.Event;
- import net.minecraftforge.fml.BrandingControl;
- import net.minecraftforge.fml.LoadingFailedException;
- import net.minecraftforge.fml.LogicalSidedProvider;
- +import net.minecraftforge.fml.ModList;
- import net.minecraftforge.fml.ModLoader;
- import net.minecraftforge.fml.ModLoadingStage;
- import net.minecraftforge.fml.ModLoadingWarning;
- @@ -103,6 +104,7 @@ public class ClientModLoader
- private static CompletableFuture<Void> onreload(final IFutureReloadListener.IStage stage, final IResourceManager resourceManager, final IProfiler prepareProfiler, final IProfiler executeProfiler, final Executor asyncExecutor, final Executor syncExecutor) {
- return CompletableFuture.runAsync(createRunnableWithCatch(() -> startModLoading(syncExecutor)), asyncExecutor).
- + thenRunAsync(() -> postSidedRunnable(c->ModList.get().forEachModContainer((mi,mc)->mc.acceptEvent(c.get()))), syncExecutor).
- thenCompose(stage::markCompleteAwaitingOthers).
- thenRunAsync(() -> finishModLoading(syncExecutor), asyncExecutor);
- }
- @@ -120,7 +122,7 @@ public class ClientModLoader
- private static void startModLoading(Executor executor) {
- earlyLoaderGUI.handleElsewhere();
- - createRunnableWithCatch(() -> ModLoader.get().loadMods(executor, ClientModLoader::preSidedRunnable, ClientModLoader::postSidedRunnable)).run();
- + createRunnableWithCatch(() -> ModLoader.get().loadMods(executor, ClientModLoader::preSidedRunnable, $ -> {})).run();
- }
- private static void postSidedRunnable(Consumer<Supplier<Event>> perModContainerEventProcessor) {
- ----- src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java -----
- index ab40bf3af..ead5e0333 100644
- @@ -164,7 +164,7 @@ public class FMLModContainer extends ModContainer
- }
- @Override
- - protected void acceptEvent(final Event e) {
- + public void acceptEvent(final Event e) {
- this.eventBus.post(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment