浏览代码

Fix EventBuses always failing

shedaniel 3 年之前
父节点
当前提交
cdabce32e4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      forge/src/main/java/me/shedaniel/architectury/platform/forge/EventBuses.java

+ 1 - 1
forge/src/main/java/me/shedaniel/architectury/platform/forge/EventBuses.java

@@ -32,7 +32,7 @@ public final class EventBuses {
     private static final Map<String, List<Consumer<IEventBus>>> ON_REGISTERED = new HashMap<>();
     
     public static void registerModEventBus(String modId, IEventBus bus) {
-        if (EVENT_BUS_MAP.putIfAbsent(modId, bus) != bus) {
+        if (EVENT_BUS_MAP.putIfAbsent(modId, bus) != null) {
             throw new IllegalStateException("Can't register event bus for mod '" + modId + "' because it was previously registered!");
         }