mirror of https://github.com/cabaletta/baritone
fix this in a "better" way
This commit is contained in:
parent
9dad1af960
commit
0ef1558803
|
@ -43,7 +43,7 @@ public class BlockStateInterface {
|
|||
|
||||
private final ClientChunkCache provider;
|
||||
private final WorldData worldData;
|
||||
protected final BlockGetter world;
|
||||
protected final Level world;
|
||||
public final BlockPos.MutableBlockPos isPassableBlockPos;
|
||||
public final BlockGetter access;
|
||||
|
||||
|
@ -97,12 +97,9 @@ public class BlockStateInterface {
|
|||
}
|
||||
|
||||
public BlockState get0(int x, int y, int z) { // Mickey resigned
|
||||
if (worldData == null) {
|
||||
return AIR;
|
||||
}
|
||||
y -= worldData.dimension.minY();
|
||||
y -= world.dimensionType().minY();
|
||||
// Invalid vertical position
|
||||
if (y < 0 || y >= worldData.dimension.height()) {
|
||||
if (y < 0 || y >= world.dimensionType().height()) {
|
||||
return AIR;
|
||||
}
|
||||
|
||||
|
@ -127,6 +124,9 @@ public class BlockStateInterface {
|
|||
// except here, it's 512x512 tiles instead of 16x16, so even better repetition
|
||||
CachedRegion cached = prevCached;
|
||||
if (cached == null || cached.getX() != x >> 9 || cached.getZ() != z >> 9) {
|
||||
if (worldData == null) {
|
||||
return AIR;
|
||||
}
|
||||
CachedRegion region = worldData.cache.getRegion(x >> 9, z >> 9);
|
||||
if (region == null) {
|
||||
return AIR;
|
||||
|
|
Loading…
Reference in New Issue