Fix bad block lookups with cached chunks
This commit is contained in:
parent
5cdacb4939
commit
f047dd08b0
@ -43,7 +43,7 @@ public final class CachedRegion implements ICachedChunkAccess {
|
|||||||
public final PathingBlockType getBlockType(int x, int y, int z) {
|
public final PathingBlockType getBlockType(int x, int y, int z) {
|
||||||
CachedChunk chunk = this.getChunk(x >> 4, z >> 4);
|
CachedChunk chunk = this.getChunk(x >> 4, z >> 4);
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
return chunk.getBlockType(x, y, z);
|
return chunk.getBlockType(x & 15, y, z & 15);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ public final class CachedWorld implements ICachedChunkAccess {
|
|||||||
public final PathingBlockType getBlockType(int x, int y, int z) {
|
public final PathingBlockType getBlockType(int x, int y, int z) {
|
||||||
CachedRegion region = getRegion(x >> 9, z >> 9);
|
CachedRegion region = getRegion(x >> 9, z >> 9);
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
return region.getBlockType(x, y, z);
|
return region.getBlockType(x & 511, y, z & 511);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user