更新内容

1. 修正兼容事件
This commit is contained in:
叁玖领域 2026-01-02 01:58:01 +08:00
parent 4247cf2c76
commit 8b9dc0c965
2 changed files with 13 additions and 6 deletions

View File

@ -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.0.22
mod_version=0.0.23
# 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

View File

@ -18,6 +18,7 @@ import net.minecraftforge.event.level.LevelEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.RegistryObject;
import top.r3944realms.lib39.Lib39;
@ -196,17 +197,23 @@ public class CommonEventHandler {
@SubscribeEvent
public static void onFMLCommonSetup (FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
IEventBus gameBus = MinecraftForge.EVENT_BUS;
try {
Class.forName("top.r3944realms.lib39.base.command.Lib39CommandHelpManager");
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
compatManager = new CompatManager(modBus, gameBus);
MinecraftForge.EVENT_BUS.post(new RegisterCompatEvent(compatManager));
compatManager.initializeAll();
});
event.enqueueWork(() -> {
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
IEventBus gameBus = MinecraftForge.EVENT_BUS;
compatManager = new CompatManager(modBus, gameBus);
});
}
@SubscribeEvent
public static void onFMLComplete(FMLLoadCompleteEvent event) {
event.enqueueWork(()->MinecraftForge.EVENT_BUS.post(new RegisterCompatEvent(compatManager)));
event.enqueueWork(() -> compatManager.initializeAll());
}
/**