fix weird cache behavior at chunk edge
This commit is contained in:
parent
518fa1c74d
commit
343bb20bd8
11
src/main/java/baritone/cache/ChunkPacker.java
vendored
11
src/main/java/baritone/cache/ChunkPacker.java
vendored
@ -112,15 +112,20 @@ public final class ChunkPacker {
|
|||||||
if (MovementHelper.possiblyFlowing(state)) {
|
if (MovementHelper.possiblyFlowing(state)) {
|
||||||
return PathingBlockType.AVOID;
|
return PathingBlockType.AVOID;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
(x != 15 && MovementHelper.possiblyFlowing(chunk.getBlockState(x + 1, y, z)))
|
||||||
|
|| (x != 0 && MovementHelper.possiblyFlowing(chunk.getBlockState(x - 1, y, z)))
|
||||||
|
|| (z != 15 && MovementHelper.possiblyFlowing(chunk.getBlockState(x, y, z + 1)))
|
||||||
|
|| (z != 0 && MovementHelper.possiblyFlowing(chunk.getBlockState(x, y, z - 1)))
|
||||||
|
) {
|
||||||
|
return PathingBlockType.AVOID;
|
||||||
|
}
|
||||||
if (x == 0 || x == 15 || z == 0 || z == 15) {
|
if (x == 0 || x == 15 || z == 0 || z == 15) {
|
||||||
if (BlockLiquid.getSlopeAngle(chunk.getWorld(), new BlockPos(x + chunk.x << 4, y, z + chunk.z << 4), state.getMaterial(), state) == -1000.0F) {
|
if (BlockLiquid.getSlopeAngle(chunk.getWorld(), new BlockPos(x + chunk.x << 4, y, z + chunk.z << 4), state.getMaterial(), state) == -1000.0F) {
|
||||||
return PathingBlockType.WATER;
|
return PathingBlockType.WATER;
|
||||||
}
|
}
|
||||||
return PathingBlockType.AVOID;
|
return PathingBlockType.AVOID;
|
||||||
}
|
}
|
||||||
if (MovementHelper.possiblyFlowing(chunk.getBlockState(x + 1, y, z)) || MovementHelper.possiblyFlowing(chunk.getBlockState(x - 1, y, z)) || MovementHelper.possiblyFlowing(chunk.getBlockState(x, y, z + 1)) || MovementHelper.possiblyFlowing(chunk.getBlockState(x, y, z - 1))) {
|
|
||||||
return PathingBlockType.AVOID;
|
|
||||||
}
|
|
||||||
return PathingBlockType.WATER;
|
return PathingBlockType.WATER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user