Fixes #5446 Listening for the same registry event in two different mods fails
Tell the mod event bus not to track phasing for events. Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
parent
180f16161c
commit
738d54ff4c
5 changed files with 7 additions and 9 deletions
|
@ -272,7 +272,7 @@ project(':forge') {
|
|||
installer 'org.ow2.asm:asm-tree:6.2'
|
||||
installer 'cpw.mods:modlauncher:0.9.+'
|
||||
installer 'net.minecraftforge:accesstransformers:0.14.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.6.+:service'
|
||||
installer 'net.minecraftforge:eventbus:0.7.+:service'
|
||||
installer 'net.minecraftforge:forgespi:0.6.+'
|
||||
installer 'net.minecraftforge:coremods:0.2.+'
|
||||
installer 'com.electronwill.night-config:core:3.4.2'
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraftforge.eventbus.api.BusBuilder;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
|
||||
import net.minecraft.crash.CrashReport;
|
||||
|
@ -42,7 +43,7 @@ public class MinecraftForge
|
|||
* ORE_GEN_BUS for ore gen events
|
||||
* EVENT_BUS for everything else
|
||||
*/
|
||||
public static final IEventBus EVENT_BUS = IEventBus.create();
|
||||
public static final IEventBus EVENT_BUS = BusBuilder.builder().build();
|
||||
|
||||
static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
package net.minecraftforge.fml;
|
||||
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.event.lifecycle.ModLifecycleEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLModContainer;
|
||||
import net.minecraftforge.forgespi.language.ILifecycleEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package net.minecraftforge.fml.javafmlmod;
|
||||
|
||||
import net.minecraftforge.eventbus.EventBusErrorMessage;
|
||||
import net.minecraftforge.eventbus.api.BusBuilder;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.IEventListener;
|
||||
|
@ -28,7 +29,6 @@ import net.minecraftforge.fml.LifecycleEventProvider;
|
|||
import net.minecraftforge.fml.ModContainer;
|
||||
import net.minecraftforge.fml.ModLoadingException;
|
||||
import net.minecraftforge.fml.ModLoadingStage;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import net.minecraftforge.forgespi.language.ModFileScanData;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class FMLModContainer extends ModContainer
|
|||
triggerMap.put(ModLoadingStage.ENQUEUE_IMC, dummy().andThen(this::beforeEvent).andThen(this::initMod).andThen(this::fireEvent).andThen(this::afterEvent));
|
||||
triggerMap.put(ModLoadingStage.PROCESS_IMC, dummy().andThen(this::beforeEvent).andThen(this::fireEvent).andThen(this::afterEvent));
|
||||
triggerMap.put(ModLoadingStage.COMPLETE, dummy().andThen(this::beforeEvent).andThen(this::completeLoading).andThen(this::fireEvent).andThen(this::afterEvent));
|
||||
this.eventBus = IEventBus.create(this::onEventFailed);
|
||||
this.eventBus = BusBuilder.builder().setExceptionHandler(this::onEventFailed).setTrackPhases(false).build();
|
||||
this.configHandler = Optional.of(event -> this.eventBus.post(event));
|
||||
final FMLJavaModLoadingContext contextExtension = new FMLJavaModLoadingContext(this);
|
||||
this.contextExtension = () -> contextExtension;
|
||||
|
|
|
@ -20,12 +20,11 @@
|
|||
package net.minecraftforge.fml.network;
|
||||
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.eventbus.api.BusBuilder;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.IEventListener;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -51,7 +50,7 @@ public class NetworkInstance
|
|||
this.networkProtocolVersion = networkProtocolVersion.get();
|
||||
this.clientAcceptedVersions = clientAcceptedVersions;
|
||||
this.serverAcceptedVersions = serverAcceptedVersions;
|
||||
this.networkEventBus = IEventBus.create(this::handleError);
|
||||
this.networkEventBus = BusBuilder.builder().setExceptionHandler(this::handleError).build();
|
||||
}
|
||||
|
||||
private void handleError(IEventBus iEventBus, Event event, IEventListener[] iEventListeners, int i, Throwable throwable)
|
||||
|
|
Loading…
Reference in a new issue