Leijurv doesn't know how unsigned works in java
This commit is contained in:
parent
6408e678ff
commit
68c2537d20
@ -233,18 +233,12 @@ public final class CachedRegion implements IBlockTypeAccess {
|
|||||||
// ^ haha jokes on leijurv, java doesn't have unsigned types so that isn't correct
|
// ^ haha jokes on leijurv, java doesn't have unsigned types so that isn't correct
|
||||||
// also why would you have more than 32767 special blocks in a chunk
|
// also why would you have more than 32767 special blocks in a chunk
|
||||||
// haha double jokes on you now it works for 65535 not just 32767
|
// haha double jokes on you now it works for 65535 not just 32767
|
||||||
int numSpecialBlockTypes = in.readShort();
|
int numSpecialBlockTypes = in.readShort() & 0xffff;
|
||||||
if (numSpecialBlockTypes < 0) {
|
|
||||||
numSpecialBlockTypes += 65536;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < numSpecialBlockTypes; i++) {
|
for (int i = 0; i < numSpecialBlockTypes; i++) {
|
||||||
String blockName = in.readUTF();
|
String blockName = in.readUTF();
|
||||||
List<BlockPos> locs = new ArrayList<>();
|
List<BlockPos> locs = new ArrayList<>();
|
||||||
location[x][z].put(blockName, locs);
|
location[x][z].put(blockName, locs);
|
||||||
int numLocations = in.readShort();
|
int numLocations = in.readShort() & 0xffff;
|
||||||
if (numLocations < 0) {
|
|
||||||
numLocations += 65536;
|
|
||||||
}
|
|
||||||
for (int j = 0; j < numLocations; j++) {
|
for (int j = 0; j < numLocations; j++) {
|
||||||
byte xz = in.readByte();
|
byte xz = in.readByte();
|
||||||
int X = xz & 0x0f;
|
int X = xz & 0x0f;
|
||||||
|
Loading…
Reference in New Issue
Block a user