From 675ebceddec28c758ade8ceca68abdfc6ff7fad9 Mon Sep 17 00:00:00 2001 From: Lyfts <127234178+Lyfts@users.noreply.github.com> Date: Sun, 26 Jan 2025 16:13:27 +0100 Subject: [PATCH] this shouldn't be instantiated server-side --- .../java/xonin/backhand/compat/TConstructCompat.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/xonin/backhand/compat/TConstructCompat.java b/src/main/java/xonin/backhand/compat/TConstructCompat.java index c4510dd..fd3a497 100644 --- a/src/main/java/xonin/backhand/compat/TConstructCompat.java +++ b/src/main/java/xonin/backhand/compat/TConstructCompat.java @@ -13,8 +13,10 @@ import com.gtnewhorizon.gtnhlib.eventbus.EventBusSubscriber; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; import tconstruct.library.tools.HarvestTool; import tconstruct.library.weaponry.IWindup; import tconstruct.tools.TinkerToolEvents; @@ -36,8 +38,11 @@ public static boolean register() { if (Mods.TINKERS_CONSTRUCT.isLoaded()) { try { // Gotta hide those NEW instructions from the JVM - crosshairHandler = CrosshairHandler.class.getConstructor() - .newInstance(); + if (FMLCommonHandler.instance() + .getSide() == Side.CLIENT) { + crosshairHandler = CrosshairHandler.class.getConstructor() + .newInstance(); + } // These need to be MethodHandles since the compiler complains about Mobs-Info not being present // otherwise onHurt = MethodHandles.publicLookup()