tterrag1098

Untitled

Dec 17th, 2019
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.55 KB | None | 0 0
  1. ------------ src/main/java/net/minecraftforge/fml/ModContainer.java ------------
  2. index 137e4cce1..944a53ca0 100644
  3. @@ -164,5 +164,5 @@ public abstract class ModContainer
  4.       * Accept an arbitrary event for processing by the mod. Probably posted to an event bus in the lower level container.
  5.       * @param e Event to accept
  6.       */
  7. -    protected void acceptEvent(Event e) {}
  8. +    public void acceptEvent(Event e) {}
  9.  }
  10.  
  11. ------- src/main/java/net/minecraftforge/fml/client/ClientModLoader.java -------
  12. index 662f18f05..f6cecb62d 100644
  13. @@ -60,6 +60,7 @@ import net.minecraftforge.eventbus.api.Event;
  14.  import net.minecraftforge.fml.BrandingControl;
  15.  import net.minecraftforge.fml.LoadingFailedException;
  16.  import net.minecraftforge.fml.LogicalSidedProvider;
  17. +import net.minecraftforge.fml.ModList;
  18.  import net.minecraftforge.fml.ModLoader;
  19.  import net.minecraftforge.fml.ModLoadingStage;
  20.  import net.minecraftforge.fml.ModLoadingWarning;
  21. @@ -103,6 +104,7 @@ public class ClientModLoader
  22.  
  23.      private static CompletableFuture<Void> onreload(final IFutureReloadListener.IStage stage, final IResourceManager resourceManager, final IProfiler prepareProfiler, final IProfiler executeProfiler, final Executor asyncExecutor, final Executor syncExecutor) {
  24.          return CompletableFuture.runAsync(createRunnableWithCatch(() -> startModLoading(syncExecutor)), asyncExecutor).
  25. +                thenRunAsync(() -> postSidedRunnable(c->ModList.get().forEachModContainer((mi,mc)->mc.acceptEvent(c.get()))), syncExecutor).
  26.                  thenCompose(stage::markCompleteAwaitingOthers).
  27.                  thenRunAsync(() -> finishModLoading(syncExecutor), asyncExecutor);
  28.      }
  29. @@ -120,7 +122,7 @@ public class ClientModLoader
  30.  
  31.      private static void startModLoading(Executor executor) {
  32.          earlyLoaderGUI.handleElsewhere();
  33. -        createRunnableWithCatch(() -> ModLoader.get().loadMods(executor, ClientModLoader::preSidedRunnable, ClientModLoader::postSidedRunnable)).run();
  34. +        createRunnableWithCatch(() -> ModLoader.get().loadMods(executor, ClientModLoader::preSidedRunnable, $ -> {})).run();
  35.      }
  36.  
  37.      private static void postSidedRunnable(Consumer<Supplier<Event>> perModContainerEventProcessor) {
  38.  
  39. ----- src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java -----
  40. index ab40bf3af..ead5e0333 100644
  41. @@ -164,7 +164,7 @@ public class FMLModContainer extends ModContainer
  42.      }
  43.  
  44.      @Override
  45. -    protected void acceptEvent(final Event e) {
  46. +    public void acceptEvent(final Event e) {
  47.          this.eventBus.post(e);
  48.      }
  49.  }
Advertisement
Add Comment
Please, Sign In to add comment