Allow breaking next to some liquids
This commit is contained in:
		| @@ -107,6 +107,13 @@ public final class Settings { | |||||||
|      */ |      */ | ||||||
|     public final Setting<Double> walkOnWaterOnePenalty = new Setting<>(3D); |     public final Setting<Double> walkOnWaterOnePenalty = new Setting<>(3D); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * Don't allow breaking blocks next to liquids. | ||||||
|  |      * <p> | ||||||
|  |      * Enable if you have mods adding custom fluid physics. | ||||||
|  |      */ | ||||||
|  |     public final Setting<Boolean> strictLiquidCheck = new Setting<>(false); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Allow Baritone to fall arbitrary distances and place a water bucket beneath it. |      * Allow Baritone to fall arbitrary distances and place a water bucket beneath it. | ||||||
|      * Reliability: questionable. |      * Reliability: questionable. | ||||||
|   | |||||||
| @@ -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) |                 && 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 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) { |     static boolean canWalkThrough(IPlayerContext ctx, BetterBlockPos pos) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user