From 316e2a50196c158668778116a328e2c190e6bcd8 Mon Sep 17 00:00:00 2001 From: SirSengir Date: Sat, 18 Aug 2012 11:29:57 +0200 Subject: [PATCH] Fixed a startup crash. --- common/buildcraft/BuildCraftFactory.java | 17 +++++++++++++++++ common/buildcraft/mod_BuildCraftFactory.java | 18 ------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java index b38c5759..d859928b 100644 --- a/common/buildcraft/BuildCraftFactory.java +++ b/common/buildcraft/BuildCraftFactory.java @@ -8,6 +8,7 @@ package buildcraft; +import cpw.mods.fml.client.registry.ClientRegistry; import buildcraft.mod_BuildCraftCore; import buildcraft.core.DefaultProps; import buildcraft.core.ProxyCore; @@ -32,6 +33,10 @@ import buildcraft.factory.TilePump; import buildcraft.factory.TileQuarry; import buildcraft.factory.TileRefinery; import buildcraft.factory.TileTank; +import buildcraft.factory.render.RenderHopper; +import buildcraft.factory.render.RenderRefinery; +import buildcraft.factory.render.RenderTank; +import buildcraft.mod_BuildCraftCore.EntityRenderIndex; import buildcraft.silicon.TileLaser; import net.minecraft.src.Block; import net.minecraft.src.Item; @@ -148,6 +153,18 @@ public class BuildCraftFactory { ProxyCore.proxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper"); } + /// FIXME: Render registration needs to move into a client side proxy. + ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank()); + ClientRegistry.bindTileEntitySpecialRenderer(TileRefinery.class, new RenderRefinery()); + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.refineryBlock, 0), + new RenderRefinery()); + + if(!hopperDisabled) { + ClientRegistry.bindTileEntitySpecialRenderer(TileHopper.class, new RenderHopper()); + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper()); + } + + drillTexture = 2 * 16 + 1; BuildCraftCore.mainConfiguration.save(); diff --git a/common/buildcraft/mod_BuildCraftFactory.java b/common/buildcraft/mod_BuildCraftFactory.java index 3a79990a..10999cac 100644 --- a/common/buildcraft/mod_BuildCraftFactory.java +++ b/common/buildcraft/mod_BuildCraftFactory.java @@ -23,15 +23,8 @@ import buildcraft.BuildCraftFactory; import buildcraft.core.DefaultProps; import buildcraft.core.render.RenderVoid; import buildcraft.factory.EntityMechanicalArm; -import buildcraft.factory.TileHopper; -import buildcraft.factory.TileRefinery; -import buildcraft.factory.TileTank; import buildcraft.factory.gui.GuiAutoCrafting; import buildcraft.factory.network.PacketHandlerFactory; -import buildcraft.factory.render.RenderHopper; -import buildcraft.factory.render.RenderRefinery; -import buildcraft.factory.render.RenderTank; -import buildcraft.mod_BuildCraftCore.EntityRenderIndex; import net.minecraft.src.ModLoader; @@ -59,17 +52,6 @@ public class mod_BuildCraftFactory { // CoreProxy.registerGUI(this, // Utils.packetIdToInt(PacketIds.AutoCraftingGUI)); - ModLoader.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank", new RenderTank()); - - ModLoader.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery", new RenderRefinery()); - - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.refineryBlock, 0), - new RenderRefinery()); - - ModLoader.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper", new RenderHopper()); - - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper()); - // Detect the presence of NEI and add overlay for the Autocrafting Table try { Class neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer");