From 273601c09fd74aaaa5f125d090a297d6fc5eb1b5 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Sun, 14 Jul 2024 22:07:05 +1000 Subject: [PATCH] Fix Server-Side Crash --- src/main/java/com/nomiceu/nomilabs/NomiLabs.java | 3 ++- .../com/nomiceu/nomilabs/event/ClientProxy.java | 12 ++++++++++++ .../com/nomiceu/nomilabs/event/CommonProxy.java | 13 ------------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/nomiceu/nomilabs/NomiLabs.java b/src/main/java/com/nomiceu/nomilabs/NomiLabs.java index 3bafbead..fa7c9734 100644 --- a/src/main/java/com/nomiceu/nomilabs/NomiLabs.java +++ b/src/main/java/com/nomiceu/nomilabs/NomiLabs.java @@ -61,7 +61,8 @@ public void preInit(FMLPreInitializationEvent event) { @EventHandler public void postInit(FMLPostInitializationEvent event) { - CommonProxy.postInit(); + if (LabsSide.isClient()) + ClientProxy.postInit(); } @EventHandler diff --git a/src/main/java/com/nomiceu/nomilabs/event/ClientProxy.java b/src/main/java/com/nomiceu/nomilabs/event/ClientProxy.java index ee8b102f..5a03c7cd 100644 --- a/src/main/java/com/nomiceu/nomilabs/event/ClientProxy.java +++ b/src/main/java/com/nomiceu/nomilabs/event/ClientProxy.java @@ -40,6 +40,18 @@ public static void latePreInit() { LabsTierHelper.preInit(); } + public static void postInit() { + // Load EnderIO Keybinds, Make Sure Loaded Before Groovy Keybind Overrides + if (Loader.isModLoaded(LabsValues.ENDER_IO_MODID)) { + try { + Class.forName("crazypants.enderio.base.handler.KeyTracker"); + } catch (ClassNotFoundException e) { + NomiLabs.LOGGER.error( + "Failed to load EnderIO's KeyTracker Class! Overrides for Ender IO Keybindings may not be available!"); + } + } + } + @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { LabsItems.registerModels(); diff --git a/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java b/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java index 0e12d9e5..a1bc484c 100644 --- a/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java +++ b/src/main/java/com/nomiceu/nomilabs/event/CommonProxy.java @@ -21,7 +21,6 @@ import com.cleanroommc.groovyscript.event.GsHandEvent; import com.cleanroommc.groovyscript.event.ScriptRunEvent; import com.nomiceu.nomilabs.LabsValues; -import com.nomiceu.nomilabs.NomiLabs; import com.nomiceu.nomilabs.block.registry.LabsBlocks; import com.nomiceu.nomilabs.config.LabsConfig; import com.nomiceu.nomilabs.creativetab.registry.LabsCreativeTabs; @@ -102,18 +101,6 @@ public static void preInit() { LabsDimensions.register(); } - public static void postInit() { - // Load EnderIO Keybinds, Make Sure Loaded Before Groovy Keybind Overrides - if (Loader.isModLoaded(LabsValues.ENDER_IO_MODID)) { - try { - Class.forName("crazypants.enderio.base.handler.KeyTracker"); - } catch (ClassNotFoundException e) { - NomiLabs.LOGGER.error( - "Failed to load EnderIO's KeyTracker Class! Overrides for Ender IO Keybindings may not be available!"); - } - } - } - public static void loadComplete() { FluidRegistryMixinHelper.loadComplete();