Skip to content

Commit

Permalink
only register NeiHandler on client
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilzinsel64 committed Jan 8, 2025
1 parent cec2e50 commit 12bc14d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/zerofall/ezstorage/nei/NeiHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@

import com.zerofall.ezstorage.gui.GuiStorageCore;

import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.guihook.IContainerObjectHandler;
import cpw.mods.fml.common.Optional.Interface;

@Interface(iface = "codechicken.nei.guihook.IContainerObjectHandler", modid = "NotEnoughItems")
public class NeiHandler implements IContainerObjectHandler {

public static void init() {
GuiContainerManager.addObjectHandler(new NeiHandler());
}

@Override
public void guiTick(GuiContainer gui) {}

Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/zerofall/ezstorage/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
import com.zerofall.ezstorage.EZStorage;
import com.zerofall.ezstorage.nei.NeiHandler;

import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInitializationEvent;

public class ClientProxy extends CommonProxy {

@Override
public void init(EZStorage instance, FMLInitializationEvent event) {
super.init(instance, event);
GuiContainerManager.addObjectHandler(new NeiHandler());

if (Loader.isModLoaded("NotEnoughItems")) {
NeiHandler.init();
}
}
}

0 comments on commit 12bc14d

Please sign in to comment.