Skip to content

Commit e08684f

Browse files
committed
decoupled SlotInfo from HotbarManager
1 parent fbd505b commit e08684f

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,6 @@ object HotbarManager : RequestHandler<HotbarRequest>(), Loadable {
148148
}
149149
}
150150

151-
data class SlotInfo(
152-
val slot: Int,
153-
var keepTicks: Int,
154-
var swapPause: Int
155-
) {
156-
var activeRequestAge = 0
157-
var swapPauseAge = 0
158-
val swapPaused get() = swapPauseAge < swapPause
159-
}
160-
161151
override fun preEvent() = UpdateManagerEvent.Hotbar.Pre().post()
162152
override fun postEvent() = UpdateManagerEvent.Hotbar.Post().post()
163153
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class HotbarRequest(
2525
priority: Priority = 0,
2626
val actionSequence: HotbarManager.HotbarActionSequence.() -> Unit,
2727
) : Request(priority) {
28-
var swapSlot: HotbarManager.SlotInfo? = null
28+
var swapSlot: SlotInfo? = null
2929

3030
var instantActionsComplete = false
3131
override val done: Boolean
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.interaction.request.hotbar
19+
20+
data class SlotInfo(
21+
val slot: Int,
22+
var keepTicks: Int,
23+
var swapPause: Int
24+
) {
25+
var activeRequestAge = 0
26+
var swapPauseAge = 0
27+
val swapPaused get() = swapPauseAge < swapPause
28+
}

0 commit comments

Comments
 (0)