Initial fixup for 1.2.3 and forge 1.3.4.33 - no custom handling code yet

This commit is contained in:
Christian Weeks 2012-03-06 15:38:21 -05:00
parent 2ec8e30faa
commit 7ad52f475a
9 changed files with 32 additions and 16 deletions

View File

@ -4,6 +4,6 @@
<classpathentry kind="src" path="common"/> <classpathentry kind="src" path="common"/>
<classpathentry kind="src" path="server"/> <classpathentry kind="src" path="server"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry combineaccessrules="false" kind="src" path="/minecraft1.1-client"/> <classpathentry combineaccessrules="false" kind="src" path="/forge1.3.4.33-client"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -13,8 +13,8 @@
</description> </description>
<property name="modname" value="mod_ironchests" /> <property name="modname" value="mod_ironchests" />
<property name="version" value="2.5" /> <property name="version" value="3.0-alpha" />
<property name="mcp.home" location="/home/cpw/minecraft1dev/forge1.3.3.12" /> <property name="mcp.home" location="/home/cpw/projects/mcworkspace/forge1.3.4" />
<property name="mcp.obfoutput" location="${mcp.home}/reobf" /> <property name="mcp.obfoutput" location="${mcp.home}/reobf" />
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" /> <property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
<property name="server.mcp.obfoutput" location="${mcp.obfoutput}/minecraft_server" /> <property name="server.mcp.obfoutput" location="${mcp.obfoutput}/minecraft_server" />
@ -54,7 +54,9 @@
<antcall target="clean-source"> <antcall target="clean-source">
<param name="side" value="server" /> <param name="side" value="server" />
</antcall> </antcall>
<exec executable="${mcp.home}/updatemd5.sh" dir="${mcp.home}" /> <exec executable="${mcp.home}/updatemd5.sh" dir="${mcp.home}">
<arg value="-f"/>
</exec>
</target> </target>
<target name="build-client" depends="init,clean,merge-client,buildandreobfmcp"> <target name="build-client" depends="init,clean,merge-client,buildandreobfmcp">

View File

@ -30,17 +30,17 @@ public class ClientProxy extends BaseModMp implements IProxy {
@Override @Override
public void registerTileEntities() { public void registerTileEntities() {
for (IronChestType typ : IronChestType.values()) { for (IronChestType typ : IronChestType.values()) {
ModLoader.RegisterTileEntity(typ.clazz, typ.name(), new TileEntityIronChestRenderer()); ModLoader.registerTileEntity(typ.clazz, typ.name(), new TileEntityIronChestRenderer());
} }
} }
@Override @Override
public void registerTranslations() { public void registerTranslations() {
for (IronChestType typ : IronChestType.values()) { for (IronChestType typ : IronChestType.values()) {
ModLoader.AddLocalization(typ.name() + ".name", typ.friendlyName); ModLoader.addLocalization(typ.name() + ".name", typ.friendlyName);
} }
for (ChestChangerType typ : ChestChangerType.values()) { for (ChestChangerType typ : ChestChangerType.values()) {
ModLoader.AddLocalization("item."+typ.itemName+".name", typ.descriptiveName); ModLoader.addLocalization("item."+typ.itemName+".name", typ.descriptiveName);
} }
} }

View File

@ -48,7 +48,7 @@ public class GUIChest extends GuiContainer {
public static void showGUI(TileEntityIronChest te, EntityPlayer player) { public static void showGUI(TileEntityIronChest te, EntityPlayer player) {
GUIChest gui=buildGUI(te.getType(),player.inventory,te); GUIChest gui=buildGUI(te.getType(),player.inventory,te);
if (gui!=null) { if (gui!=null) {
ModLoader.OpenGUI(player, gui); ModLoader.openGUI(player, gui);
} else { } else {
player.displayGUIChest(te); player.displayGUIChest(te);
} }

View File

@ -78,7 +78,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
lidangle = 1.0F - lidangle * lidangle * lidangle; lidangle = 1.0F - lidangle * lidangle * lidangle;
model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F); model.chestLid.rotateAngleX = -((lidangle * 3.141593F) / 2.0F);
// Render the chest itself // Render the chest itself
model.func_35402_a(); model.renderAll();
glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); glDisable(32826 /* GL_RESCALE_NORMAL_EXT */);
glPopMatrix(); glPopMatrix();
glColor4f(1.0F, 1.0F, 1.0F, 1.0F); glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -115,7 +115,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
shift++; shift++;
ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(item.itemID); ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(item.itemID);
float localScale = blockScale; 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(); int j = Block.blocksList[item.itemID].getRenderType();
if (j == 1 || j == 19 || j == 12 || j == 2) { if (j == 1 || j == 19 || j == 12 || j == 2) {
localScale = 2 * blockScale; localScale = 2 * blockScale;
@ -138,13 +138,13 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer {
bindTextureByName("/terrain.png"); bindTextureByName("/terrain.png");
ForgeHooksClient.overrideTexture(item.getItem()); ForgeHooksClient.overrideTexture(item.getItem());
ForgeHooksClient.renderCustomItem(customRenderer, renderBlocks, item.itemID, item.getItemDamage(), 1.0F); 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"); bindTextureByName("/terrain.png");
ForgeHooksClient.overrideTexture(Block.blocksList[item.itemID]); ForgeHooksClient.overrideTexture(Block.blocksList[item.itemID]);
renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0F); renderBlocks.renderBlockAsItem(Block.blocksList[item.itemID], item.getItemDamage(), 1.0F);
} else { } else {
int i = item.getIconIndex(); 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"); bindTextureByName("/gui/items.png");
ForgeHooksClient.overrideTexture(Item.itemsList[item.itemID]); ForgeHooksClient.overrideTexture(Item.itemsList[item.itemID]);
} else { } else {

View File

@ -95,7 +95,7 @@ public enum IronChestType {
} }
public static void addRecipe(ItemStack is, Object... parts) { public static void addRecipe(ItemStack is, Object... parts) {
ModLoader.AddRecipe(is, parts); ModLoader.addRecipe(is, parts);
} }
public int getGUI() { public int getGUI() {

View File

@ -361,4 +361,18 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
} }
return null; 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;
}
}
} }

View File

@ -45,7 +45,7 @@ public class mod_IronChest extends BaseModMp {
cfg.save(); cfg.save();
} }
ModLoader.RegisterBlock(ironChestBlock, ItemIronChest.class); ModLoader.registerBlock(ironChestBlock, ItemIronChest.class);
MinecraftForge.registerOreHandler(new IOreHandler() { MinecraftForge.registerOreHandler(new IOreHandler() {
@Override @Override
public void registerOre(String oreClass, ItemStack ore) { public void registerOre(String oreClass, ItemStack ore) {

View File

@ -61,12 +61,12 @@ public class ServerProxy implements IProxy {
@Override @Override
public Packet getDescriptionPacket(TileEntityIronChest tile) { 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 @Override
public void sendTileEntityUpdate(TileEntityIronChest tile) { public void sendTileEntityUpdate(TileEntityIronChest tile) {
ModLoaderMp.SendTileEntityPacket(tile); ModLoaderMp.sendTileEntityPacket(tile);
} }
@Override @Override