@@ -47,7 +47,6 @@ import com.lambda.interaction.request.placing.PlaceManager
4747import com.lambda.interaction.request.rotation.RotationRequest
4848import com.lambda.threading.runSafe
4949import com.lambda.util.BlockUtils.blockState
50- import com.lambda.util.BlockUtils.calcItemBlockBreakingDelta
5150import com.lambda.util.Communication.warn
5251import com.lambda.util.item.ItemUtils.block
5352import com.lambda.util.player.gamemode
@@ -227,7 +226,12 @@ object BreakManager : RequestHandler<BreakRequest>(
227226 .asReversed()
228227 .forEach { info ->
229228 if (info.updatedProgressThisTick) return @forEach
230- if (! info.context.requestDependencies(info.request)) return @run
229+ val minKeepTicks = if (info.isSecondary) {
230+ val breakDelta = info.context.checkedState.calcBlockBreakingDelta(player, world, info.context.expectedPos)
231+ val breakAmount = breakDelta * info.breakingTicks
232+ if (breakAmount >= 1.0f ) 1 else 0
233+ } else 0
234+ if (! info.context.requestDependencies(info.request, minKeepTicks)) return @run
231235 if (tickStage !in info.breakConfig.breakStageMask) return @forEach
232236 if ((! rotated && info.isPrimary)) return @run
233237
@@ -545,11 +549,10 @@ object BreakManager : RequestHandler<BreakRequest>(
545549 }
546550
547551 info.breakingTicks++
548- val progress = blockState.calcItemBlockBreakingDelta (
552+ val progress = blockState.calcBlockBreakingDelta (
549553 player,
550554 world,
551- ctx.expectedPos,
552- player.mainHandStack
555+ ctx.expectedPos
553556 ) * if (info.isSecondary || info.isRedundant) {
554557 info.breakingTicks - info.breakConfig.doubleBreakFudgeFactor
555558 } else info.breakingTicks
@@ -637,7 +640,7 @@ object BreakManager : RequestHandler<BreakRequest>(
637640 blockState.onBlockBreakStart(world, ctx.expectedPos, player)
638641 }
639642
640- val breakDelta = blockState.calcItemBlockBreakingDelta (player, world, ctx.expectedPos, player.mainHandStack )
643+ val breakDelta = blockState.calcBlockBreakingDelta (player, world, ctx.expectedPos)
641644 if (notAir && breakDelta >= info.getBreakThreshold()) {
642645 onBlockBreak(info)
643646 } else {
0 commit comments