Update EventBus to address concurrency issue in ModLauncher Factory. Closes #8924

This commit is contained in:
LexManos committed 2022-08-07 17:35:15 -07:00
1 parent 7b97c181b9
commit c807665ab9
5 files changed
+9 -4

No files matched your search

@@ -26,7 +26,7 @@ public class MinecraftForge
* ORE_GEN_BUS for ore gen events
* EVENT_BUS for everything else
*/
public static final IEventBus EVENT_BUS = BusBuilder.builder().startShutdown().build();
public static final IEventBus EVENT_BUS = BusBuilder.builder().startShutdown().useModLauncher().build();
static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
private static final Logger LOGGER = LogManager.getLogger();
@@ -1,3 +1,8 @@
/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.common.world;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
@@ -36,7 +36,7 @@ public class NetworkInstance
this.networkProtocolVersion = networkProtocolVersion.get();
this.clientAcceptedVersions = clientAcceptedVersions;
this.serverAcceptedVersions = serverAcceptedVersions;
this.networkEventBus = BusBuilder.builder().setExceptionHandler(this::handleError).build();
this.networkEventBus = BusBuilder.builder().setExceptionHandler(this::handleError).useModLauncher().build();
}
private void handleError(IEventBus iEventBus, Event event, IEventListener[] iEventListeners, int i, Throwable throwable)