Fixed exception in conjunction with NEI integration server side. Closes #229
This commit is contained in:
parent
d24b26d960
commit
585095b0c2
3 changed files with 21 additions and 18 deletions
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
package buildcraft;
|
package buildcraft;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.Init;
|
import cpw.mods.fml.common.Mod.Init;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
|
@ -46,7 +44,6 @@ import buildcraft.factory.TilePump;
|
||||||
import buildcraft.factory.TileQuarry;
|
import buildcraft.factory.TileQuarry;
|
||||||
import buildcraft.factory.TileRefinery;
|
import buildcraft.factory.TileRefinery;
|
||||||
import buildcraft.factory.TileTank;
|
import buildcraft.factory.TileTank;
|
||||||
import buildcraft.factory.gui.GuiAutoCrafting;
|
|
||||||
import buildcraft.factory.network.PacketHandlerFactory;
|
import buildcraft.factory.network.PacketHandlerFactory;
|
||||||
import buildcraft.silicon.TileLaser;
|
import buildcraft.silicon.TileLaser;
|
||||||
import net.minecraft.src.Block;
|
import net.minecraft.src.Block;
|
||||||
|
@ -78,16 +75,8 @@ public class BuildCraftFactory {
|
||||||
public static BuildCraftFactory instance;
|
public static BuildCraftFactory instance;
|
||||||
|
|
||||||
@PostInit
|
@PostInit
|
||||||
public void postInit(FMLPostInitializationEvent evt)
|
public void postInit(FMLPostInitializationEvent evt) {
|
||||||
{
|
FactoryProxy.proxy.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.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@Init
|
@Init
|
||||||
public void load(FMLInitializationEvent evt) {
|
public void load(FMLInitializationEvent evt) {
|
||||||
|
|
|
@ -6,9 +6,7 @@ public class FactoryProxy {
|
||||||
@SidedProxy(clientSide = "buildcraft.factory.FactoryProxyClient", serverSide = "buildcraft.factory.FactoryProxy")
|
@SidedProxy(clientSide = "buildcraft.factory.FactoryProxyClient", serverSide = "buildcraft.factory.FactoryProxy")
|
||||||
public static FactoryProxy proxy;
|
public static FactoryProxy proxy;
|
||||||
|
|
||||||
public void initializeTileEntities() {
|
public void initializeTileEntities() {}
|
||||||
}
|
public void initializeEntityRenders() {}
|
||||||
|
public void initializeNEIIntegration() {}
|
||||||
public void initializeEntityRenders() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
package buildcraft.factory;
|
package buildcraft.factory;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.BuildCraftFactory;
|
import buildcraft.BuildCraftFactory;
|
||||||
import buildcraft.core.render.RenderVoid;
|
import buildcraft.core.render.RenderVoid;
|
||||||
import buildcraft.core.render.RenderingEntityBlocks;
|
import buildcraft.core.render.RenderingEntityBlocks;
|
||||||
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
|
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
|
||||||
|
import buildcraft.factory.gui.GuiAutoCrafting;
|
||||||
import buildcraft.factory.render.RenderHopper;
|
import buildcraft.factory.render.RenderHopper;
|
||||||
import buildcraft.factory.render.RenderRefinery;
|
import buildcraft.factory.render.RenderRefinery;
|
||||||
import buildcraft.factory.render.RenderTank;
|
import buildcraft.factory.render.RenderTank;
|
||||||
|
@ -29,4 +33,16 @@ public class FactoryProxyClient extends FactoryProxy {
|
||||||
public void initializeEntityRenders() {
|
public void initializeEntityRenders() {
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class, new RenderVoid());
|
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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue