File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -385,6 +385,12 @@ public final class Settings {
385385 */
386386 public final Setting <Float > blockReachDistance = new Setting <>(4.5f );
387387
388+ /**
389+ * How many ticks between breaking a block and starting to break the next block. Default in game is 6 ticks.
390+ * Values under 2 will be clamped.
391+ */
392+ public final Setting <Integer > blockBreakSpeed = new Setting <>(6 );
393+
388394 /**
389395 * How many degrees to randomize the pitch and yaw every tick. Set to 0 to disable
390396 */
Original file line number Diff line number Diff line change 1717
1818package baritone .utils ;
1919
20+ import baritone .api .BaritoneAPI ;
2021import baritone .api .utils .IPlayerContext ;
2122import net .minecraft .world .InteractionHand ;
2223import net .minecraft .world .phys .BlockHitResult ;
2728 * @since 8/25/2018
2829 */
2930public final class BlockBreakHelper {
31+ // base ticks between block breaks caused by tick logic
32+ private static final int BASE_BREAK_DELAY = 2 ;
3033
3134 private final IPlayerContext ctx ;
3235 private boolean didBreakLastTick ;
36+ private int breakDelayTimer = 0 ;
3337
3438 BlockBreakHelper (IPlayerContext ctx ) {
3539 this .ctx = ctx ;
@@ -48,6 +52,10 @@ public void stopBreakingBlock() {
4852 }
4953
5054 public void tick (boolean isLeftClick ) {
55+ if (breakDelayTimer > 0 ) {
56+ breakDelayTimer --;
57+ return ;
58+ }
5159 HitResult trace = ctx .objectMouseOver ();
5260 boolean isBlockTrace = trace != null && trace .getType () == HitResult .Type .BLOCK ;
5361
@@ -68,6 +76,7 @@ public void tick(boolean isLeftClick) {
6876 didBreakLastTick = true ;
6977 } else if (didBreakLastTick ) {
7078 stopBreakingBlock ();
79+ breakDelayTimer = BaritoneAPI .getSettings ().blockBreakSpeed .value - BASE_BREAK_DELAY ;
7180 didBreakLastTick = false ;
7281 }
7382 }
You can’t perform that action at this time.
0 commit comments