Allow breaking next to some liquids

This commit is contained in:
ZacSharp
2022-11-22 15:15:33 +01:00
parent 93501248cd
commit eabd1150b0
2 changed files with 19 additions and 1 deletions

View File

@@ -77,7 +77,18 @@ public interface MovementHelper extends ActionCosts, Helper {
&& BlockFalling.canFallThrough(bsi.get0(x, y - 1, z))) { // and if it would fall (i.e. it's unsupported)
return true; // dont break a block that is adjacent to unsupported gravel because it can cause really weird stuff
}
return block instanceof BlockLiquid;
if (block instanceof BlockLiquid) {
if (directlyAbove || Baritone.settings().strictLiquidCheck.value) {
return true;
}
int level = state.getValue(BlockLiquid.LEVEL);
if (level == 0) {
return true; // source blocks like to flow horizontally
}
// everything else will prefer flowing down
return !(bsi.get0(x, y - 1, z).getBlock() instanceof BlockLiquid); // assume everything is in a static state
}
return false;
}
static boolean canWalkThrough(IPlayerContext ctx, BetterBlockPos pos) {