diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java index 45fac13b..f330ab21 100644 --- a/common/buildcraft/BuildCraftFactory.java +++ b/common/buildcraft/BuildCraftFactory.java @@ -8,8 +8,6 @@ package buildcraft; -import java.lang.reflect.Method; - import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; @@ -46,7 +44,6 @@ import buildcraft.factory.TilePump; import buildcraft.factory.TileQuarry; import buildcraft.factory.TileRefinery; import buildcraft.factory.TileTank; -import buildcraft.factory.gui.GuiAutoCrafting; import buildcraft.factory.network.PacketHandlerFactory; import buildcraft.silicon.TileLaser; import net.minecraft.src.Block; @@ -78,16 +75,8 @@ public class BuildCraftFactory { public static BuildCraftFactory instance; @PostInit - public void postInit(FMLPostInitializationEvent evt) - { - try { - Class neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer"); - Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class); - method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11); - BuildCraftCore.bcLog.fine("NEI detected, adding NEI overlay"); - } catch (Exception e) { - BuildCraftCore.bcLog.fine("NEI not detected."); - } + public void postInit(FMLPostInitializationEvent evt) { + FactoryProxy.proxy.initializeNEIIntegration(); } @Init public void load(FMLInitializationEvent evt) { diff --git a/common/buildcraft/factory/FactoryProxy.java b/common/buildcraft/factory/FactoryProxy.java index 0d135b48..1c7b4f0e 100644 --- a/common/buildcraft/factory/FactoryProxy.java +++ b/common/buildcraft/factory/FactoryProxy.java @@ -6,9 +6,7 @@ public class FactoryProxy { @SidedProxy(clientSide = "buildcraft.factory.FactoryProxyClient", serverSide = "buildcraft.factory.FactoryProxy") public static FactoryProxy proxy; - public void initializeTileEntities() { - } - - public void initializeEntityRenders() { - } + public void initializeTileEntities() {} + public void initializeEntityRenders() {} + public void initializeNEIIntegration() {} } diff --git a/common/buildcraft/factory/FactoryProxyClient.java b/common/buildcraft/factory/FactoryProxyClient.java index dd7f7acd..0fa9cd4d 100644 --- a/common/buildcraft/factory/FactoryProxyClient.java +++ b/common/buildcraft/factory/FactoryProxyClient.java @@ -1,9 +1,13 @@ package buildcraft.factory; +import java.lang.reflect.Method; + +import buildcraft.BuildCraftCore; import buildcraft.BuildCraftFactory; import buildcraft.core.render.RenderVoid; import buildcraft.core.render.RenderingEntityBlocks; import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex; +import buildcraft.factory.gui.GuiAutoCrafting; import buildcraft.factory.render.RenderHopper; import buildcraft.factory.render.RenderRefinery; import buildcraft.factory.render.RenderTank; @@ -29,4 +33,16 @@ public class FactoryProxyClient extends FactoryProxy { public void initializeEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid()); } + + @Override + public void initializeNEIIntegration() { + try { + Class neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer"); + Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class); + method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11); + BuildCraftCore.bcLog.fine("NEI detected, adding NEI overlay"); + } catch (Exception e) { + BuildCraftCore.bcLog.fine("NEI not detected."); + } + } }