diff --git a/gradle.properties b/gradle.properties index 3bbaa11..b4216fd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ mod_name=3944Realms 's Lib Mod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=MIT # The mod version. See https://semver.org/ -mod_version=0.2.0 +mod_version=0.2.1 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/top/r3944realms/lib39/core/event/CommonEventHandler.java b/src/main/java/top/r3944realms/lib39/core/event/CommonEventHandler.java index 50c7b00..5a6f50b 100644 --- a/src/main/java/top/r3944realms/lib39/core/event/CommonEventHandler.java +++ b/src/main/java/top/r3944realms/lib39/core/event/CommonEventHandler.java @@ -255,7 +255,6 @@ public class CommonEventHandler { // 在Mod总线上发布事件 modBus.post(new RegisterCompatEvent(compatManager)); - compatManager.initializeAll(); Lib39.LOGGER.info("RegisterCompatEvent published during construct phase"); }); } @@ -273,6 +272,13 @@ public class CommonEventHandler { } catch (ClassNotFoundException e) { throw new RuntimeException(e); } + + // 在这里初始化兼容模块,给其他模组足够的时间注册 + if (compatManager != null) { + compatManager.initializeAll(); + Lib39.LOGGER.info("CompatManager initialized with {} modules", + compatManager.getLoadedCompats().size()); + } }); }