@@ -229,10 +229,8 @@ object BreakManager : RequestHandler<BreakRequest>(
229229 info.breakConfig,
230230 if (! info.isRedundant) player.inventory.getStack(info.context.hotbarIndex) else null
231231 )
232- val progress = (info.breakingTicks * breakDelta).let {
233- if (info.isPrimary) it * (2 - info.breakConfig.breakThreshold)
234- else it
235- }.toDouble() * (1 - (breakDelta * config.fudgeFactor))
232+ val threshold = if (info.isPrimary) info.breakConfig.breakThreshold else 1f
233+ val progress = (info.breakingTicks * breakDelta).toDouble() / (threshold + (breakDelta * config.fudgeFactor))
236234 val state = info.context.cachedState
237235 val boxes = state.getOutlineShape(world, info.context.blockPos).boundingBoxes.map {
238236 it.offset(info.context.blockPos)
@@ -562,17 +560,19 @@ object BreakManager : RequestHandler<BreakRequest>(
562560 private fun BreakInfo.cancelBreak () =
563561 runSafe {
564562 if (isRedundant || abandoned) return @runSafe
565- setBreakingTextureStage(player, world, - 1 )
566563 if (isPrimary) {
567564 if (breaking) abortBreakPacket(world, interaction)
568565 nullify()
566+ setBreakingTextureStage(player, world, - 1 )
569567 request.onCancel?.invoke(context.blockPos)
570568 } else if (isSecondary) {
571569 if (breakConfig.unsafeCancels) {
572570 makeRedundant()
571+ setBreakingTextureStage(player, world, - 1 )
573572 request.onCancel?.invoke(context.blockPos)
573+ } else {
574+ abandoned = true
574575 }
575- else abandoned = true
576576 }
577577 }
578578
0 commit comments