From f341fdfd61d99bbe70e57c4b8060cad0268c1960 Mon Sep 17 00:00:00 2001 From: LexManos Date: Sun, 19 Aug 2012 17:41:21 -0700 Subject: [PATCH] Fix IndexOutOfBounds exception, Major derp. --- patches/common/net/minecraft/src/Packet51MapChunk.java.patch | 4 ++-- patches/common/net/minecraft/src/Packet56MapChunks.java.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/common/net/minecraft/src/Packet51MapChunk.java.patch b/patches/common/net/minecraft/src/Packet51MapChunk.java.patch index db7b75519..6bcaf58a7 100644 --- a/patches/common/net/minecraft/src/Packet51MapChunk.java.patch +++ b/patches/common/net/minecraft/src/Packet51MapChunk.java.patch @@ -5,9 +5,9 @@ var3 = 12288 * var2; + int msb = 0; //BugFix: MC does not read the MSB array from the packet properly, causing issues for servers that use blocks > 256 -+ for (var3 = 0; var3 < 16; ++var3) ++ for (int x = 0; x < 16; x++) + { -+ msb += this.yChMax >> var3 & 1; ++ msb += (yChMax >> x) & 1; + } + var3 += (2048 * msb); + diff --git a/patches/common/net/minecraft/src/Packet56MapChunks.java.patch b/patches/common/net/minecraft/src/Packet56MapChunks.java.patch index 3a8c9dc30..581065efd 100644 --- a/patches/common/net/minecraft/src/Packet56MapChunks.java.patch +++ b/patches/common/net/minecraft/src/Packet56MapChunks.java.patch @@ -6,9 +6,9 @@ - var8 = 2048 * 5 * var7 + 256; + int msb = 0; //BugFix: MC does not read the MSB array from the packet properly, causing issues for servers that use blocks > 256 -+ for (var8 = 0; var8 < 16; ++var8) ++ for (int x = 0; x < 16; x++) + { -+ msb += this.field_73588_b[var6] >> var8 & 1; ++ msb += (field_73588_b[var6] >> x) & 1; + } + + var8 = 2048 * 5 * var7 + (2048 * msb) + 256;