Skip to content

Commit 2d0d955

Browse files
committed
ignore fudge factor if break is instant in swap info
1 parent 766681c commit 2d0d955

File tree

1 file changed

+6
-2
lines changed
  • src/main/kotlin/com/lambda/interaction/request/breaking

1 file changed

+6
-2
lines changed

src/main/kotlin/com/lambda/interaction/request/breaking/SwapInfo.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ data class SwapInfo(
4848
.calcItemBlockBreakingDelta(player, world, context.blockPos, swapStack)
4949
val breakDeltaNoEfficiency = context.cachedState
5050
.calcItemBlockBreakingDelta(player, world, context.blockPos, swapStack, ignoreEfficiency = true)
51+
52+
val threshold = getBreakThreshold()
53+
5154
val breakTicks = (if (rebreakPotential.isPossible()) RebreakManager.rebreak?.breakingTicks
5255
?: throw IllegalStateException("Rebreak BreakInfo was null when rebreak was considered possible")
5356
else breakingTicks).let {
5457
// Plus one as this is calculated before this ticks progress is calculated and the breakingTicks are incremented
55-
(it + 1) - breakConfig.fudgeFactor
58+
(it + 1).let {
59+
if (breakDelta >= threshold) it else it - breakConfig.fudgeFactor
60+
}
5661
}
57-
val threshold = getBreakThreshold()
5862

5963
val minKeepTicks = run {
6064
if (type == Primary) {

0 commit comments

Comments
 (0)