Skip to content

Commit

Permalink
this shouldn't be instantiated server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed Jan 26, 2025
1 parent 381541c commit 675ebce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/xonin/backhand/compat/TConstructCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
Expand Down

0 comments on commit 675ebce

Please sign in to comment.