Skip to content

Commit a3a8bd8

Browse files
committed
idk what i was thinking at 5 am
1 parent 71baf3b commit a3a8bd8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/main/kotlin/com/lambda/config/groups/BreakSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BreakSettings(
5151
// Fixes / Delays
5252
override val breakThreshold by c.setting("Break Threshold", 0.70f, 0.1f..1.0f, 0.01f, "The break amount at which the block is considered broken", visibility = vis).group(groupPath, Group.General)
5353
override val fudgeFactor by c.setting("Fudge Factor", 1, 0..5, 1, "The number of ticks to add to the break time, usually to account for server lag", visibility = vis).group(groupPath, Group.General)
54-
override val serverSwapTicks by c.setting("Server Swap", 1, 0..5, 1, "The number of ticks to give the server time to recognize the player attributes on the swapped item", " tick(s)", visibility = vis).group(groupPath, Group.General)
54+
override val serverSwapTicks by c.setting("Server Swap", 2, 0..5, 1, "The number of ticks to give the server time to recognize the player attributes on the swapped item", " tick(s)", visibility = vis).group(groupPath, Group.General)
5555
// override val desyncFix by c.setting("Desync Fix", false, "Predicts if the players breaking will be slowed next tick as block break packets are processed using the players next position") { vis() && page == Page.General }
5656
override val breakDelay by c.setting("Break Delay", 0, 0..6, 1, "The delay between breaking blocks", " tick(s)", visibility = vis).group(groupPath, Group.General)
5757

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ data class SwapInfo(
3232
val minKeepTicks: Int = 0,
3333
) {
3434
val canCompleteBreak
35-
get() = BreakManager.heldTicks >= if (type == Primary)
36-
breakConfig.serverSwapTicks
35+
get() = (BreakManager.heldTicks + 1) >= if (type == Primary) breakConfig.serverSwapTicks
3736
else breakConfig.serverSwapTicks.coerceAtLeast(2)
3837

3938
companion object {
@@ -58,15 +57,16 @@ data class SwapInfo(
5857

5958
val minKeepTicks = run {
6059
if (type == Primary) {
61-
val swapTickProgress = breakDelta * (breakTicks + breakConfig.serverSwapTicks)
60+
val swapTickProgress = breakDelta * (breakTicks + breakConfig.serverSwapTicks - 1)
6261
val withoutEfficiency = breakDeltaNoEfficiency * breakTicks >= threshold
63-
if (swapTickProgress >= threshold && !withoutEfficiency && swapStack.heldTicks < breakConfig.serverSwapTicks) 1
62+
if (swapTickProgress >= threshold &&
63+
!withoutEfficiency) 1
6464
else 0
6565
} else {
66-
val swapTickProgress = breakDelta * (breakTicks + breakConfig.serverSwapTicks.coerceAtLeast(2) - 1)
67-
val withinSecondarySwapRange = swapTickProgress >= threshold ||
68-
(breakDelta * breakTicks >= threshold && breakDelta * (breakTicks - 1) < threshold)
69-
if (withinSecondarySwapRange) 1 else 0
66+
val serverSwapTicks = breakConfig.serverSwapTicks.coerceAtLeast(2)
67+
val swapTickProgress = breakDelta * (breakTicks + serverSwapTicks - 1)
68+
if (swapTickProgress >= threshold && swapStack.heldTicks < serverSwapTicks) 1
69+
else 0
7070
}
7171
}
7272

0 commit comments

Comments
 (0)