From 343bb20bd861d48bc7a04e1fd7faf2783721be6f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 17 Apr 2019 20:02:02 -0700 Subject: [PATCH] fix weird cache behavior at chunk edge --- src/main/java/baritone/cache/ChunkPacker.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/cache/ChunkPacker.java b/src/main/java/baritone/cache/ChunkPacker.java index cc5f2188..864f23d6 100644 --- a/src/main/java/baritone/cache/ChunkPacker.java +++ b/src/main/java/baritone/cache/ChunkPacker.java @@ -112,15 +112,20 @@ public final class ChunkPacker { if (MovementHelper.possiblyFlowing(state)) { 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 (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.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; }