From 7ad52f475aa6398ec0912dd77cadc69b408c4728 Mon Sep 17 00:00:00 2001 From: Christian Weeks Date: Tue, 6 Mar 2012 15:38:21 -0500 Subject: [PATCH] Initial fixup for 1.2.3 and forge 1.3.4.33 - no custom handling code yet --- IronChests2/.classpath | 2 +- IronChests2/build.xml | 8 +++++--- .../cpw/mods/ironchest/client/ClientProxy.java | 6 +++--- .../client/cpw/mods/ironchest/client/GUIChest.java | 2 +- .../client/TileEntityIronChestRenderer.java | 8 ++++---- .../common/cpw/mods/ironchest/IronChestType.java | 2 +- .../cpw/mods/ironchest/TileEntityIronChest.java | 14 ++++++++++++++ .../common/net/minecraft/src/mod_IronChest.java | 2 +- .../cpw/mods/ironchest/server/ServerProxy.java | 4 ++-- 9 files changed, 32 insertions(+), 16 deletions(-) diff --git a/IronChests2/.classpath b/IronChests2/.classpath index 893f780..838ad7a 100644 --- a/IronChests2/.classpath +++ b/IronChests2/.classpath @@ -4,6 +4,6 @@ - + diff --git a/IronChests2/build.xml b/IronChests2/build.xml index 55d1585..6604c08 100644 --- a/IronChests2/build.xml +++ b/IronChests2/build.xml @@ -13,8 +13,8 @@ - - + + @@ -54,7 +54,9 @@ - + + + diff --git a/IronChests2/client/cpw/mods/ironchest/client/ClientProxy.java b/IronChests2/client/cpw/mods/ironchest/client/ClientProxy.java index 913fdd9..92938f4 100644 --- a/IronChests2/client/cpw/mods/ironchest/client/ClientProxy.java +++ b/IronChests2/client/cpw/mods/ironchest/client/ClientProxy.java @@ -30,17 +30,17 @@ public class ClientProxy extends BaseModMp implements IProxy { @Override public void registerTileEntities() { for (IronChestType typ : IronChestType.values()) { - ModLoader.RegisterTileEntity(typ.clazz, typ.name(), new TileEntityIronChestRenderer()); + ModLoader.registerTileEntity(typ.clazz, typ.name(), new TileEntityIronChestRenderer()); } } @Override public void registerTranslations() { for (IronChestType typ : IronChestType.values()) { - ModLoader.AddLocalization(typ.name() + ".name", typ.friendlyName); + ModLoader.addLocalization(typ.name() + ".name", typ.friendlyName); } for (ChestChangerType typ : ChestChangerType.values()) { - ModLoader.AddLocalization("item."+typ.itemName+".name", typ.descriptiveName); + ModLoader.addLocalization("item."+typ.itemName+".name", typ.descriptiveName); } } diff --git a/IronChests2/client/cpw/mods/ironchest/client/GUIChest.java b/IronChests2/client/cpw/mods/ironchest/client/GUIChest.java index c19c1ea..05bd1e7 100644 --- a/IronChests2/client/cpw/mods/ironchest/client/GUIChest.java +++ b/IronChests2/client/cpw/mods/ironchest/client/GUIChest.java @@ -48,7 +48,7 @@ public class GUIChest extends GuiContainer { public static void showGUI(TileEntityIronChest te, EntityPlayer player) { GUIChest gui=buildGUI(te.getType(),player.inventory,te); if (gui!=null) { - ModLoader.OpenGUI(player, gui); + ModLoader.openGUI(player, gui); } else { player.displayGUIChest(te); } diff --git a/IronChests2/client/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/IronChests2/client/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index 7877923..55421e5 100644 --- a/IronChests2/client/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/IronChests2/client/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -78,7 +78,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { lidangle = 1.0F - lidangle * lidangle * lidangle; model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); // Render the chest itself - model.func_35402_a(); + model.renderAll(); glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); glPopMatrix(); glColor4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -115,7 +115,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { shift++; ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(item.itemID); float localScale = blockScale; - if (item.itemID < Block.blocksList.length) { + if (item.itemID < Block.blocksList.length && Block.blocksList[item.itemID]!=null) { int j = Block.blocksList[item.itemID].getRenderType(); if (j == 1 || j == 19 || j == 12 || j == 2) { localScale = 2 * blockScale; @@ -138,13 +138,13 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer { bindTextureByName("/terrain.png"); ForgeHooksClient.overrideTexture(item.getItem()); ForgeHooksClient.renderCustomItem(customRenderer, renderBlocks, item.itemID, item.getItemDamage(), 1.0F); - } else if (item.itemID < Block.blocksList.length && RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())) { + } else if (item.itemID < Block.blocksList.length && Block.blocksList[item.itemID]!=null && RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())) { bindTextureByName("/terrain.png"); ForgeHooksClient.overrideTexture(Block.blocksList[item.itemID]); renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0F); } else { int i = item.getIconIndex(); - if (item.itemID >= Block.blocksList.length) { + if (item.itemID >= Block.blocksList.length || Block.blocksList[item.itemID]==null) { bindTextureByName("/gui/items.png"); ForgeHooksClient.overrideTexture(Item.itemsList[item.itemID]); } else { diff --git a/IronChests2/common/cpw/mods/ironchest/IronChestType.java b/IronChests2/common/cpw/mods/ironchest/IronChestType.java index 0edc143..718f178 100644 --- a/IronChests2/common/cpw/mods/ironchest/IronChestType.java +++ b/IronChests2/common/cpw/mods/ironchest/IronChestType.java @@ -95,7 +95,7 @@ public enum IronChestType { } public static void addRecipe(ItemStack is, Object... parts) { - ModLoader.AddRecipe(is, parts); + ModLoader.addRecipe(is, parts); } public int getGUI() { diff --git a/IronChests2/common/cpw/mods/ironchest/TileEntityIronChest.java b/IronChests2/common/cpw/mods/ironchest/TileEntityIronChest.java index 6fed2d8..2c5d323 100644 --- a/IronChests2/common/cpw/mods/ironchest/TileEntityIronChest.java +++ b/IronChests2/common/cpw/mods/ironchest/TileEntityIronChest.java @@ -361,4 +361,18 @@ public class TileEntityIronChest extends TileEntity implements IInventory { } return null; } + + public ItemStack func_48081_b(int par1) + { + if (this.chestContents[par1] != null) + { + ItemStack var2 = this.chestContents[par1]; + this.chestContents[par1] = null; + return var2; + } + else + { + return null; + } + } } diff --git a/IronChests2/common/net/minecraft/src/mod_IronChest.java b/IronChests2/common/net/minecraft/src/mod_IronChest.java index 7ce20fb..61fc114 100644 --- a/IronChests2/common/net/minecraft/src/mod_IronChest.java +++ b/IronChests2/common/net/minecraft/src/mod_IronChest.java @@ -45,7 +45,7 @@ public class mod_IronChest extends BaseModMp { cfg.save(); } - ModLoader.RegisterBlock(ironChestBlock, ItemIronChest.class); + ModLoader.registerBlock(ironChestBlock, ItemIronChest.class); MinecraftForge.registerOreHandler(new IOreHandler() { @Override public void registerOre(String oreClass, ItemStack ore) { diff --git a/IronChests2/server/cpw/mods/ironchest/server/ServerProxy.java b/IronChests2/server/cpw/mods/ironchest/server/ServerProxy.java index 633a1d4..27acd21 100644 --- a/IronChests2/server/cpw/mods/ironchest/server/ServerProxy.java +++ b/IronChests2/server/cpw/mods/ironchest/server/ServerProxy.java @@ -61,12 +61,12 @@ public class ServerProxy implements IProxy { @Override public Packet getDescriptionPacket(TileEntityIronChest tile) { - return ModLoaderMp.GetTileEntityPacket(ModLoaderMp.GetModInstance(mod_IronChest.class), tile.xCoord, tile.yCoord, tile.zCoord, tile.getType().ordinal(), tile.buildIntDataList(),null,null); + return ModLoaderMp.getTileEntityPacket(ModLoaderMp.GetModInstance(mod_IronChest.class), tile.xCoord, tile.yCoord, tile.zCoord, tile.getType().ordinal(), tile.buildIntDataList(),null,null); } @Override public void sendTileEntityUpdate(TileEntityIronChest tile) { - ModLoaderMp.SendTileEntityPacket(tile); + ModLoaderMp.sendTileEntityPacket(tile); } @Override