fix clients receiving invalid biome ID from server

This commit is contained in:
FalsePattern committed 2022-07-11 20:44:49 +02:00
1 parent 3ceaa51119
commit 24796dab0c
1 file changed
+2 -2
@@ -154,7 +154,7 @@ public class Hooks {
for (int i = 0; i < 256; ++i) {
byteArray[i] = (byte) (shortArray[i] & 255);
byteArray[i + 256] = (byte) (shortArray[i] >>> 8);
byteArray[i + 256] = (byte) ((shortArray[i] >>> 8) & 255);
}
return byteArray;
}
@@ -163,7 +163,7 @@ public class Hooks {
short[] shortArray = new short[256];
for (int i = 0; i < 256; ++i) {
shortArray[i] = (short) (byteArray[i + 256] << 8 | byteArray[i]);
shortArray[i] = (short) (((byteArray[i + 256] << 8) & 255) | (byteArray[i] & 255));
}
return shortArray;