package net.mcft.copy.betterstorage.addon.nei;

import net.mcft.copy.betterstorage.addon.Addon;
import net.mcft.copy.betterstorage.client.gui.GuiCraftingStation;
import net.mcft.copy.betterstorage.content.BetterStorageTiles;
import net.mcft.copy.betterstorage.misc.Constants;
import net.minecraft.item.ItemStack;
import codechicken.nei.api.API;
import codechicken.nei.recipe.DefaultOverlayHandler;

public class NEIAddon extends Addon {
	
	public NEIAddon() {
		super("NotEnoughItems");
	}
	
	@Override
	public void postInitialize() {	
		
		NEIRecipeHandler handler = new NEIRecipeHandler();
		API.registerRecipeHandler(handler);
		API.registerUsageHandler(handler);
		
		API.registerGuiOverlay(GuiCraftingStation.class, Constants.modId + ".craftingStation");
		API.registerGuiOverlayHandler(GuiCraftingStation.class, new DefaultOverlayHandler(),
		                              Constants.modId + ".craftingStation");
		
		API.hideItem(new ItemStack(BetterStorageTiles.lockableDoor));
		
	}
	
}

@@ -390,16 +390,61 @@
 Handler;
+%0Aimport cpw.mods.fml.common.FMLCommonHandler;
 %0A%0Apublic
@@ -574,16 +574,89 @@
 ze() %7B%09%0A
+%09%09if (FMLCommonHandler.instance().getEffectiveSide().isServer()) return;%0A
 %09%09%0A%09%09NEI

Fix NEI addon crashing servers