From c3bdc6e58368a0c471c7d24ba23b8dc5721d943b Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 15 Jun 2012 21:10:37 -0700 Subject: [PATCH] Initial 4096 fix based of mDiyo's work. --- .../minecraft/src/forge/ForgeHooksClient.java | 2 + .../src/forge/PacketHandlerClient.java | 2 + .../minecraft/src/forge/MinecraftForge.java | 31 ++++++++++ .../src/forge/packets/ForgePacket.java | 1 - .../src/forge/packets/PacketModList.java | 12 ++++ .../src/forge/PacketHandlerServer.java | 4 ++ .../minecraft/src/EntityEnderman.java.patch | 11 ++++ .../net/minecraft/src/Item.java.patch | 10 +++- .../net/minecraft/src/ItemMap.java.patch | 20 +++++++ .../net/minecraft/src/ItemRenderer.java.patch | 26 ++++----- .../src/Packet53BlockChange.java.patch | 51 +++++++++++++++++ .../net/minecraft/src/RenderItem.java.patch | 57 +++++++++++-------- .../net/minecraft/src/StatList.java.patch | 14 +++++ .../minecraft/src/EntityEnderman.java.patch | 11 ++++ .../net/minecraft/src/Item.java.patch | 9 +++ .../net/minecraft/src/ItemMap.java.patch | 20 +++++++ .../src/Packet53BlockChange.java.patch | 28 +++++++++ .../net/minecraft/src/StatList.java.patch | 14 +++++ 18 files changed, 284 insertions(+), 39 deletions(-) create mode 100644 forge/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch create mode 100644 forge/patches/minecraft/net/minecraft/src/ItemMap.java.patch create mode 100644 forge/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch create mode 100644 forge/patches/minecraft/net/minecraft/src/StatList.java.patch create mode 100644 forge/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch create mode 100644 forge/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch create mode 100644 forge/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch create mode 100644 forge/patches/minecraft_server/net/minecraft/src/StatList.java.patch diff --git a/forge/forge_client/src/net/minecraft/src/forge/ForgeHooksClient.java b/forge/forge_client/src/net/minecraft/src/forge/ForgeHooksClient.java index 5ae0314dd..ad6bca361 100644 --- a/forge/forge_client/src/net/minecraft/src/forge/ForgeHooksClient.java +++ b/forge/forge_client/src/net/minecraft/src/forge/ForgeHooksClient.java @@ -38,6 +38,7 @@ public class ForgeHooksClient { private static Field textureID = null; private static boolean textureIDChecked = false; + public static boolean enable4096 = false; //If the server has told us that 4096 is enabled. public static boolean onBlockHighlight(RenderGlobal render, EntityPlayer player, MovingObjectPosition target, int i, ItemStack itemstack, float partialTicks) { @@ -575,6 +576,7 @@ public class ForgeHooksClient */ public static Packet onSendLogin(Packet1Login pkt) { + enable4096 = false; //Disable 4096 packet modification untill the server says yes. pkt.serverMode = ForgePacket.FORGE_ID; pkt.field_48170_e = ForgeHooks.buildVersion; return pkt; diff --git a/forge/forge_client/src/net/minecraft/src/forge/PacketHandlerClient.java b/forge/forge_client/src/net/minecraft/src/forge/PacketHandlerClient.java index 18aa70bf4..467a15422 100644 --- a/forge/forge_client/src/net/minecraft/src/forge/PacketHandlerClient.java +++ b/forge/forge_client/src/net/minecraft/src/forge/PacketHandlerClient.java @@ -160,6 +160,8 @@ public class PacketHandlerClient extends PacketHandlerBase { System.out.println("S->C: " + packet.toString(true)); } + + ForgeHooksClient.enable4096 = packet.has4096; ForgeHooks.networkMods.clear(); NetworkMod[] mods = MinecraftForge.getNetworkMods(); diff --git a/forge/forge_common/net/minecraft/src/forge/MinecraftForge.java b/forge/forge_common/net/minecraft/src/forge/MinecraftForge.java index 3cd5f93bd..29333f9b5 100755 --- a/forge/forge_common/net/minecraft/src/forge/MinecraftForge.java +++ b/forge/forge_common/net/minecraft/src/forge/MinecraftForge.java @@ -12,6 +12,7 @@ import net.minecraft.src.Entity; import net.minecraft.src.EntityMinecart; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; +import net.minecraft.src.Material; import net.minecraft.src.ModLoader; import net.minecraft.src.NetworkManager; import net.minecraft.src.Packet; @@ -20,6 +21,7 @@ import net.minecraft.src.Packet132TileEntityData; import net.minecraft.src.World; import net.minecraft.src.forge.oredict.OreDictionary; +import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.Map.Entry; @@ -1202,6 +1204,35 @@ public class MinecraftForge return isClient == 1; } + /** + * Method invoked by FML before any other mods are loaded. + */ + public static void initialize() + { + //Cause the classes to initialize if they already haven't + Block.stone.getTextureFile(); + Item.appleGold.getTextureFile(); + + Block filler = null; + try + { + filler = Block.class.getConstructor(int.class, Material.class).newInstance(256, Material.air); + }catch (Exception e){} + + if (filler == null) + { + throw new RuntimeException("Could not create Forge filler block"); + } + + for (int x = 256; x < 4096; x++) + { + if (Item.itemsList[x - 256] != null) + { + Block.blocksList[x] = filler; + } + } + } + static { addDungeonMob("Skeleton", 1.0f); diff --git a/forge/forge_common/net/minecraft/src/forge/packets/ForgePacket.java b/forge/forge_common/net/minecraft/src/forge/packets/ForgePacket.java index 49e54121f..b739e427d 100644 --- a/forge/forge_common/net/minecraft/src/forge/packets/ForgePacket.java +++ b/forge/forge_common/net/minecraft/src/forge/packets/ForgePacket.java @@ -21,7 +21,6 @@ public abstract class ForgePacket public Packet getPacket() { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); DataOutputStream data = new DataOutputStream(bytes); try diff --git a/forge/forge_common/net/minecraft/src/forge/packets/PacketModList.java b/forge/forge_common/net/minecraft/src/forge/packets/PacketModList.java index bd02438cb..302cfb57e 100644 --- a/forge/forge_common/net/minecraft/src/forge/packets/PacketModList.java +++ b/forge/forge_common/net/minecraft/src/forge/packets/PacketModList.java @@ -2,6 +2,7 @@ package net.minecraft.src.forge.packets; import java.io.DataInputStream; import java.io.DataOutputStream; +import java.io.EOFException; import java.io.IOException; import java.util.Hashtable; import java.util.List; @@ -13,6 +14,7 @@ public class PacketModList extends ForgePacket public String[] Mods; public Hashtable ModIDs = new Hashtable(); public int Length = -1; + public boolean has4096 = false; public PacketModList(boolean server) { @@ -39,6 +41,7 @@ public class PacketModList extends ForgePacket data.writeUTF(entry.getValue()); } } + data.writeBoolean(true); } @Override @@ -64,6 +67,15 @@ public class PacketModList extends ForgePacket ModIDs.put(data.readInt(), data.readUTF()); } } + + try + { + has4096 = data.readBoolean(); + } + catch (EOFException e) + { + has4096 = false; + } } @Override diff --git a/forge/forge_server/src/net/minecraft/src/forge/PacketHandlerServer.java b/forge/forge_server/src/net/minecraft/src/forge/PacketHandlerServer.java index ad6abc2b3..37f69a7cd 100644 --- a/forge/forge_server/src/net/minecraft/src/forge/PacketHandlerServer.java +++ b/forge/forge_server/src/net/minecraft/src/forge/PacketHandlerServer.java @@ -55,6 +55,10 @@ public class PacketHandlerServer extends PacketHandlerBase net.kickPlayer("Invalid mod list response, Size: " + pkt.Length); return; } + if (!pkt.has4096) + { + net.kickPlayer("Must have Forge build #136+ (4096 fix) to connect to this server"); + } if (pkt.Mods.length == 0) { ModLoader.getLogger().log(Level.INFO, net.getUsername() + " joined with no mods"); diff --git a/forge/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch b/forge/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch new file mode 100644 index 000000000..707208bf2 --- /dev/null +++ b/forge/patches/minecraft/net/minecraft/src/EntityEnderman.java.patch @@ -0,0 +1,11 @@ +--- ../src_base/minecraft/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 +@@ -2,7 +2,7 @@ + + public class EntityEnderman extends EntityMob + { +- private static boolean[] canCarryBlocks = new boolean[256]; ++ private static boolean[] canCarryBlocks = new boolean[Block.blocksList.length]; + + /** Is the enderman attacking another entity? */ + public boolean isAttacking = false; diff --git a/forge/patches/minecraft/net/minecraft/src/Item.java.patch b/forge/patches/minecraft/net/minecraft/src/Item.java.patch index a5a40e34d..99ce28209 100644 --- a/forge/patches/minecraft/net/minecraft/src/Item.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/Item.java.patch @@ -14,7 +14,7 @@ { /** The RNG used by the Item subclasses. */ protected static Random itemRand = new Random(); -@@ -188,7 +191,10 @@ +@@ -188,14 +191,17 @@ /** full name of item from language file */ private String itemName; @@ -26,6 +26,14 @@ protected Item(int par1) { this.shiftedIndex = 256 + par1; + + if (itemsList[256 + par1] != null) + { +- System.out.println("CONFLICT @ " + par1); ++ System.out.println("CONFLICT @ " + par1 + " item slot already occupied by " + itemsList[256 + par1] + " while adding " + this); + } + + itemsList[256 + par1] = this; @@ -551,7 +557,7 @@ float var17 = MathHelper.sin(-var5 * 0.017453292F); float var18 = var15 * var16; diff --git a/forge/patches/minecraft/net/minecraft/src/ItemMap.java.patch b/forge/patches/minecraft/net/minecraft/src/ItemMap.java.patch new file mode 100644 index 000000000..875518d5e --- /dev/null +++ b/forge/patches/minecraft/net/minecraft/src/ItemMap.java.patch @@ -0,0 +1,20 @@ +--- ../src_base/minecraft/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 +@@ -83,7 +83,7 @@ + byte var23 = 0; + byte var24 = 0; + byte var25 = 0; +- int[] var26 = new int[256]; ++ int[] var26 = new int[Block.blocksList.length]; + Chunk var27 = par1World.getChunkFromBlockCoords(var21, var22); + int var28 = var21 & 15; + int var29 = var22 & 15; +@@ -173,7 +173,7 @@ + var33 = 0; + var34 = 0; + +- for (var35 = 0; var35 < 256; ++var35) ++ for (var35 = 0; var35 < Block.blocksList.length; ++var35) + { + if (var26[var35] > var33) + { diff --git a/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch b/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch index d37544828..720b105cd 100644 --- a/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/ItemRenderer.java.patch @@ -13,7 +13,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -@@ -35,21 +41,27 @@ +@@ -35,22 +41,21 @@ public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) { GL11.glPushMatrix(); @@ -25,7 +25,7 @@ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); + ForgeHooksClient.renderEquippedItem(customRenderer, renderBlocksInstance, par1EntityLiving, par2ItemStack); + } -+ else if (par2ItemStack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) ++ else if (par2ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType())) { - GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png")); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); @@ -33,19 +33,19 @@ } else { - if (par2ItemStack.itemID < 256) - { +- if (par2ItemStack.itemID < 256) +- { - GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png")); -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); - } - else - { +- } +- else +- { - GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png")); -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); - } +- } ++ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile())); Tessellator var4 = Tessellator.instance; -@@ -246,8 +258,10 @@ + int var5 = par1EntityLiving.getItemIcon(par2ItemStack, par3); +@@ -246,8 +251,10 @@ float var11; float var13; @@ -57,7 +57,7 @@ GL11.glPushMatrix(); var7 = 0.8F; var17 = var3.getSwingProgress(par1); -@@ -313,8 +327,15 @@ +@@ -313,8 +320,15 @@ var26.addVertexWithUV((double)(128 + var27), (double)(0 - var27), 0.0D, 1.0D, 0.0D); var26.addVertexWithUV((double)(0 - var27), (double)(0 - var27), 0.0D, 0.0D, 0.0D); var26.draw(); @@ -75,7 +75,7 @@ GL11.glPopMatrix(); } else if (var14 != null) -@@ -414,12 +435,15 @@ +@@ -414,12 +428,15 @@ if (var14.getItem().requiresMultipleRenderPasses()) { this.renderItem(var3, var14, 0); diff --git a/forge/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch b/forge/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch new file mode 100644 index 000000000..d4c5ac62e --- /dev/null +++ b/forge/patches/minecraft/net/minecraft/src/Packet53BlockChange.java.patch @@ -0,0 +1,51 @@ +--- ../src_base/minecraft/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 +@@ -4,6 +4,8 @@ + import java.io.DataOutputStream; + import java.io.IOException; + ++import net.minecraft.src.forge.ForgeHooksClient; ++ + public class Packet53BlockChange extends Packet + { + /** Block X position. */ +@@ -34,7 +36,14 @@ + this.xPosition = par1DataInputStream.readInt(); + this.yPosition = par1DataInputStream.read(); + this.zPosition = par1DataInputStream.readInt(); +- this.type = par1DataInputStream.read(); ++ if (ForgeHooksClient.enable4096) ++ { ++ this.type = par1DataInputStream.readInt(); ++ } ++ else ++ { ++ this.type = par1DataInputStream.read(); ++ } + this.metadata = par1DataInputStream.read(); + } + +@@ -46,7 +55,14 @@ + par1DataOutputStream.writeInt(this.xPosition); + par1DataOutputStream.write(this.yPosition); + par1DataOutputStream.writeInt(this.zPosition); +- par1DataOutputStream.write(this.type); ++ if (ForgeHooksClient.enable4096) ++ { ++ par1DataOutputStream.writeInt(this.type); ++ } ++ else ++ { ++ par1DataOutputStream.write(this.type); ++ } + par1DataOutputStream.write(this.metadata); + } + +@@ -63,6 +79,6 @@ + */ + public int getPacketSize() + { +- return 11; ++ return ForgeHooksClient.enable4096 ? 14 : 11; + } + } diff --git a/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch b/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch index 0bd8bf040..26a5ae756 100644 --- a/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/RenderItem.java.patch @@ -21,7 +21,7 @@ + { + ; + } -+ else if (var10.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) ++ else if (var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) { GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F); - this.loadTexture("/terrain.png"); @@ -43,30 +43,37 @@ var15 = var10.getItem().func_46057_a(var10.getItemDamage(), var14); var16 = 1.0F; -@@ -120,11 +128,11 @@ - - if (var10.itemID < 256) - { +@@ -117,15 +125,8 @@ + { + GL11.glScalef(0.5F, 0.5F, 0.5F); + var14 = var10.getIconIndex(); +- +- if (var10.itemID < 256) +- { - this.loadTexture("/terrain.png"); -+ this.loadTexture(Block.blocksList[var10.itemID].getTextureFile()); - } - else - { +- } +- else +- { - this.loadTexture("/gui/items.png"); -+ this.loadTexture(Item.itemsList[var10.itemID].getTextureFile()); - } +- } ++ ++ this.loadTexture(var10.getItem().getTextureFile()); if (this.field_27004_a) -@@ -189,7 +197,7 @@ + { +@@ -187,9 +188,9 @@ + float var12; + float var13; - if (par3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType())) +- if (par3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType())) ++ if (Item.itemsList[par3] instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType())) { - par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png")); + par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Block.blocksList[par3].getTextureFile())); Block var15 = Block.blocksList[par3]; GL11.glPushMatrix(); GL11.glTranslatef((float)(par6 - 2), (float)(par7 + 3), -3.0F + this.zLevel); -@@ -221,9 +229,9 @@ +@@ -221,9 +222,9 @@ if (Item.itemsList[par3].requiresMultipleRenderPasses()) { GL11.glDisable(GL11.GL_LIGHTING); @@ -78,21 +85,23 @@ { int var9 = Item.itemsList[par3].func_46057_a(par4, var8); var10 = Item.itemsList[par3].getColorFromDamage(par4, var8); -@@ -247,11 +255,11 @@ +@@ -245,14 +246,7 @@ + { + GL11.glDisable(GL11.GL_LIGHTING); - if (par3 < 256) - { +- if (par3 < 256) +- { - par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png")); -+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Block.blocksList[par3].getTextureFile())); - } - else - { +- } +- else +- { - par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png")); -+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[par3].getTextureFile())); - } +- } ++ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[par3].getTextureFile())); var8 = Item.itemsList[par3].getColorFromDamage(par4, 0); -@@ -279,7 +287,10 @@ + float var14 = (float)(var8 >> 16 & 255) / 255.0F; +@@ -279,7 +273,10 @@ { if (par3ItemStack != null) { diff --git a/forge/patches/minecraft/net/minecraft/src/StatList.java.patch b/forge/patches/minecraft/net/minecraft/src/StatList.java.patch new file mode 100644 index 000000000..40656ca2d --- /dev/null +++ b/forge/patches/minecraft/net/minecraft/src/StatList.java.patch @@ -0,0 +1,14 @@ +--- ../src_base/minecraft/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 +@@ -166,9 +166,9 @@ + */ + private static StatBase[] initMinableStats(String par0Str, int par1) + { +- StatBase[] var2 = new StatBase[256]; ++ StatBase[] var2 = new StatBase[Block.blocksList.length]; + +- for (int var3 = 0; var3 < 256; ++var3) ++ for (int var3 = 0; var3 < Block.blocksList.length; ++var3) + { + if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) + { diff --git a/forge/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch b/forge/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch new file mode 100644 index 000000000..3643cf33d --- /dev/null +++ b/forge/patches/minecraft_server/net/minecraft/src/EntityEnderman.java.patch @@ -0,0 +1,11 @@ +--- ../src_base/minecraft_server/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft_server/net/minecraft/src/EntityEnderman.java 0000-00-00 00:00:00.000000000 -0000 +@@ -2,7 +2,7 @@ + + public class EntityEnderman extends EntityMob + { +- private static boolean[] canCarryBlocks = new boolean[256]; ++ private static boolean[] canCarryBlocks = new boolean[Block.blocksList.length]; + + /** Is the enderman attacking another entity? */ + public boolean isAttacking = false; diff --git a/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch index 73af47ba7..3fe585ce5 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/Item.java.patch @@ -23,6 +23,15 @@ protected Item(int par1) { +@@ -198,7 +204,7 @@ + + if (itemsList[256 + par1] != null) + { +- System.out.println("CONFLICT @ " + par1); ++ System.out.println("CONFLICT @ " + par1 + " item slot already occupied by " + itemsList[256 + par1] + " while adding " + this); + } + + itemsList[256 + par1] = this; @@ -492,6 +498,10 @@ float var18 = var15 * var16; float var20 = var14 * var16; diff --git a/forge/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch b/forge/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch new file mode 100644 index 000000000..cbed0c91c --- /dev/null +++ b/forge/patches/minecraft_server/net/minecraft/src/ItemMap.java.patch @@ -0,0 +1,20 @@ +--- ../src_base/minecraft_server/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft_server/net/minecraft/src/ItemMap.java 0000-00-00 00:00:00.000000000 -0000 +@@ -68,7 +68,7 @@ + byte var23 = 0; + byte var24 = 0; + byte var25 = 0; +- int[] var26 = new int[256]; ++ int[] var26 = new int[Block.blocksList.length]; + Chunk var27 = par1World.getChunkFromBlockCoords(var21, var22); + int var28 = var21 & 15; + int var29 = var22 & 15; +@@ -158,7 +158,7 @@ + var33 = 0; + var34 = 0; + +- for (var35 = 0; var35 < 256; ++var35) ++ for (var35 = 0; var35 < Block.blocksList.length; ++var35) + { + if (var26[var35] > var33) + { diff --git a/forge/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch b/forge/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch new file mode 100644 index 000000000..7c4b78544 --- /dev/null +++ b/forge/patches/minecraft_server/net/minecraft/src/Packet53BlockChange.java.patch @@ -0,0 +1,28 @@ +--- ../src_base/minecraft_server/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft_server/net/minecraft/src/Packet53BlockChange.java 0000-00-00 00:00:00.000000000 -0000 +@@ -44,7 +44,7 @@ + this.xPosition = par1DataInputStream.readInt(); + this.yPosition = par1DataInputStream.read(); + this.zPosition = par1DataInputStream.readInt(); +- this.type = par1DataInputStream.read(); ++ this.type = par1DataInputStream.readInt(); //4096 + this.metadata = par1DataInputStream.read(); + } + +@@ -56,7 +56,7 @@ + par1DataOutputStream.writeInt(this.xPosition); + par1DataOutputStream.write(this.yPosition); + par1DataOutputStream.writeInt(this.zPosition); +- par1DataOutputStream.write(this.type); ++ par1DataOutputStream.writeInt(this.type); //4096 + par1DataOutputStream.write(this.metadata); + } + +@@ -73,6 +73,6 @@ + */ + public int getPacketSize() + { +- return 11; ++ return 14; + } + } diff --git a/forge/patches/minecraft_server/net/minecraft/src/StatList.java.patch b/forge/patches/minecraft_server/net/minecraft/src/StatList.java.patch new file mode 100644 index 000000000..6713f755d --- /dev/null +++ b/forge/patches/minecraft_server/net/minecraft/src/StatList.java.patch @@ -0,0 +1,14 @@ +--- ../src_base/minecraft_server/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 ++++ ../src_work/minecraft_server/net/minecraft/src/StatList.java 0000-00-00 00:00:00.000000000 -0000 +@@ -166,9 +166,9 @@ + */ + private static StatBase[] initMinableStats(String par0Str, int par1) + { +- StatBase[] var2 = new StatBase[256]; ++ StatBase[] var2 = new StatBase[Block.blocksList.length]; + +- for (int var3 = 0; var3 < 256; ++var3) ++ for (int var3 = 0; var3 < Block.blocksList.length; ++var3) + { + if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) + {