mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-16 07:35:31 +01:00
Fix the coordinate-packing for block entity-loading
This commit fixes the incorrect shifting of bits when packing the chunk-local coordinates of a block entity into a 64-bit long for lookups.
This commit is contained in:
parent
b10d15657a
commit
574bc6f9e8
@ -121,7 +121,7 @@ public Chunk_1_13(MCAWorld world, Data data) {
|
||||
}
|
||||
|
||||
this.blockEntities = level.blockEntities.stream().collect(Collectors.toMap(
|
||||
it -> (long) it.getY() << 40 | (it.getX() & 0xF) << 4 | it.getZ() & 0xF, it -> it
|
||||
it -> (long) it.getY() << 8 | (it.getX() & 0xF) << 4 | it.getZ() & 0xF, it -> it
|
||||
));
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ public int getOceanFloorY(int x, int z) {
|
||||
|
||||
@Override
|
||||
public @Nullable BlockEntity getBlockEntity(int x, int y, int z) {
|
||||
return blockEntities.get((long) y << 40 | (x & 0xF) << 4 | z & 0xF);
|
||||
return blockEntities.get((long) y << 8 | (x & 0xF) << 4 | z & 0xF);
|
||||
}
|
||||
|
||||
private @Nullable Section getSection(int y) {
|
||||
|
@ -120,7 +120,7 @@ public Chunk_1_16(MCAWorld world, Data data) {
|
||||
}
|
||||
|
||||
this.blockEntities = level.blockEntities.stream().collect(Collectors.toMap(
|
||||
it -> (long) it.getY() << 40 | (it.getX() & 0xF) << 4 | it.getZ() & 0xF, it -> it
|
||||
it -> (long) it.getY() << 8 | (it.getX() & 0xF) << 4 | it.getZ() & 0xF, it -> it
|
||||
));
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ public int getOceanFloorY(int x, int z) {
|
||||
|
||||
@Override
|
||||
public @Nullable BlockEntity getBlockEntity(int x, int y, int z) {
|
||||
return blockEntities.get((long) y << 40 | (x & 0xF) << 4 | z & 0xF);
|
||||
return blockEntities.get((long) y << 8 | (x & 0xF) << 4 | z & 0xF);
|
||||
}
|
||||
|
||||
private @Nullable Section getSection(int y) {
|
||||
|
@ -117,7 +117,7 @@ public Chunk_1_18(MCAWorld world, Data data) {
|
||||
}
|
||||
|
||||
this.blockEntities = data.blockEntities.stream().collect(Collectors.toMap(
|
||||
it -> (long) it.getY() << 40 | (it.getX() & 0xF) << 4 | it.getZ() & 0xF, it -> it
|
||||
it -> (long) it.getY() << 8 | (it.getX() & 0xF) << 4 | it.getZ() & 0xF, it -> it
|
||||
));
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ public int getOceanFloorY(int x, int z) {
|
||||
|
||||
@Override
|
||||
public @Nullable BlockEntity getBlockEntity(int x, int y, int z) {
|
||||
return blockEntities.get((long) y << 40 | (x & 0xF) << 4 | z & 0xF);
|
||||
return blockEntities.get((long) y << 8 | (x & 0xF) << 4 | z & 0xF);
|
||||
}
|
||||
|
||||
private @Nullable Section getSection(int y) {
|
||||
|
Loading…
Reference in New Issue
Block a user