Skip to content

Commit 6e2691d

Browse files
committed
hotbar cleanup and small fix
1 parent 8a46bd2 commit 6e2691d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

common/src/main/kotlin/com/lambda/interaction/request/hotbar/HotbarManager.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,12 @@ object HotbarManager : RequestHandler<HotbarRequest>(), Loadable {
124124
): Boolean {
125125
request.swapSlot = SlotInfo(slot, keepTicks, request.hotbarConfig.swapDelay)
126126
if (slot != currentSlotInfo?.slot) {
127-
if (swapsThisTick + 1 > maxSwapsThisTick || swapDelay > 0) return false
127+
if (swapsThisTick + 1 > maxSwapsThisTick || swapDelay > 0) {
128+
return false
129+
}
128130

129131
currentSlotInfo?.let { current ->
130132
if (current.activeRequestAge == 0 && (current.keepTicks > 0 || current.swapPause > 0)) {
131-
request.failedSwap = true
132133
return false
133134
}
134135
}

common/src/main/kotlin/com/lambda/interaction/request/hotbar/HotbarRequest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ class HotbarRequest(
2525
priority: Priority = 0,
2626
val actionSequence: HotbarManager.HotbarActionSequence.() -> Unit,
2727
) : Request(priority) {
28-
var failedSwap = false
2928
var swapSlot: HotbarManager.SlotInfo? = null
3029

3130
var instantActionsComplete = false
3231
override val done: Boolean
33-
get() = swapSlot?.let { it.slot == HotbarManager.serverSlot && it.activeRequestAge >= it.swapPause } ?: true
32+
get() = swapSlot?.let { it.slot == HotbarManager.serverSlot && it.swapPauseAge >= it.swapPause } ?: true
3433

3534
constructor (
3635
slot: Int,

0 commit comments

Comments
 (0)