Fix MC packet bugs for remote servers that use blocks with ids > 256
This commit is contained in:
parent
a6d703edca
commit
7f40671ad8
2 changed files with 33 additions and 0 deletions
16
patches/common/net/minecraft/src/Packet51MapChunk.java.patch
Normal file
16
patches/common/net/minecraft/src/Packet51MapChunk.java.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
--- ../src_base/common/net/minecraft/src/Packet51MapChunk.java
|
||||
+++ ../src_work/common/net/minecraft/src/Packet51MapChunk.java
|
||||
@@ -100,6 +100,13 @@
|
||||
|
||||
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)
|
||||
+ {
|
||||
+ msb += this.yChMax >> var3 & 1;
|
||||
+ }
|
||||
+ var3 += (2048 * msb);
|
||||
+
|
||||
if (this.includeInitialize)
|
||||
{
|
||||
var3 += 256;
|
|
@ -0,0 +1,17 @@
|
|||
--- ../src_base/common/net/minecraft/src/Packet56MapChunks.java
|
||||
+++ ../src_work/common/net/minecraft/src/Packet56MapChunks.java
|
||||
@@ -121,7 +121,13 @@
|
||||
var7 += this.field_73590_a[var6] >> var8 & 1;
|
||||
}
|
||||
|
||||
- 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)
|
||||
+ {
|
||||
+ msb += this.field_73588_b[var6] >> var8 & 1;
|
||||
+ }
|
||||
+
|
||||
+ var8 = 2048 * 5 * var7 + (2048 * msb) + 256;
|
||||
this.field_73584_f[var6] = new byte[var8];
|
||||
System.arraycopy(var3, var5, this.field_73584_f[var6], 0, var8);
|
||||
var5 += var8;
|
Loading…
Reference in a new issue