mirror of
https://github.com/cabaletta/baritone
synced 2024-12-28 01:42:17 +00:00
pause mining for falling blocks, fixes #157
This commit is contained in:
parent
79c433b14d
commit
30469e2de2
@ -204,6 +204,11 @@ public final class Settings {
|
||||
*/
|
||||
public final Setting<Boolean> sprintAscends = new Setting<>(true);
|
||||
|
||||
/**
|
||||
* When breaking blocks for a movement, wait until all falling blocks have settled before continuing
|
||||
*/
|
||||
public final Setting<Boolean> pauseMiningForFallingBlocks = new Setting<>(true);
|
||||
|
||||
/**
|
||||
* How many ticks between right clicks are allowed. Default in game is 4
|
||||
*/
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package baritone.pathing.movement;
|
||||
|
||||
import baritone.Baritone;
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.pathing.movement.IMovement;
|
||||
import baritone.api.pathing.movement.MovementStatus;
|
||||
@ -24,7 +25,9 @@ import baritone.api.utils.*;
|
||||
import baritone.api.utils.input.Input;
|
||||
import baritone.utils.BlockStateInterface;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -140,6 +143,9 @@ public abstract class Movement implements IMovement, MovementHelper {
|
||||
}
|
||||
boolean somethingInTheWay = false;
|
||||
for (BetterBlockPos blockPos : positionsToBreak) {
|
||||
if (!ctx.world().getEntitiesWithinAABB(EntityFallingBlock.class, new AxisAlignedBB(0, 0, 0, 1, 1.1, 1).offset(blockPos)).isEmpty() && Baritone.settings().pauseMiningForFallingBlocks.value) {
|
||||
return false;
|
||||
}
|
||||
if (!MovementHelper.canWalkThrough(ctx, blockPos) && !(BlockStateInterface.getBlock(ctx, blockPos) instanceof BlockLiquid)) { // can't break liquid, so don't try
|
||||
somethingInTheWay = true;
|
||||
Optional<Rotation> reachable = RotationUtils.reachable(ctx.player(), blockPos, ctx.playerController().getBlockReachDistance());
|
||||
|
Loading…
Reference in New Issue
Block a user