Skip to content

Commit fd41e6e

Browse files
committed
inline instantBreaks list
1 parent ff5d79d commit fd41e6e

File tree

1 file changed

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

1 file changed

+2
-8
lines changed

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakManager.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
8989

9090
private var blockBreakingCooldown = 0
9191

92-
private var instantBreaks = listOf<BreakContext>()
93-
9492
fun Any.onBreak(
9593
alwaysListen: Boolean = false,
9694
priority: Priority = 0,
@@ -126,7 +124,7 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
126124
.sortedBy { it.instantBreak }
127125
.take(maxBreaksThisTick)
128126

129-
instantBreaks = validContexts
127+
val instantBreaks = validContexts
130128
.take(breakConfig.instantBreaksPerTick)
131129
.filter { it.instantBreak }
132130
.sortedBy { it.hotbarIndex == HotbarManager.serverSlot }
@@ -140,11 +138,7 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
140138
updateBlockBreakingProgress(breakInfo)
141139
activeThisTick = true
142140
}
143-
if (instantBreaks.size == breakConfig.instantBreaksPerTick) {
144-
instantBreaks = emptyList()
145-
return@request
146-
}
147-
instantBreaks = emptyList()
141+
if (instantBreaks.size == breakConfig.instantBreaksPerTick) return@request
148142
}
149143

150144
validContexts

0 commit comments

Comments
 (0)