mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 11:24:56 -04:00
interaction handler: stop item using when changing hotbar slot
This commit is contained in:
parent
3fed73e640
commit
bd268034bf
@ -32,6 +32,7 @@ import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||
|
||||
class HotbarInteractionHandler(
|
||||
val renderWindow: RenderWindow,
|
||||
val interactionManager: InteractionManager,
|
||||
) {
|
||||
private val connection = renderWindow.connection
|
||||
val slotLimiter = RateLimiter()
|
||||
@ -48,6 +49,7 @@ class HotbarInteractionHandler(
|
||||
return
|
||||
}
|
||||
connection.player.selectedHotbarSlot = slot
|
||||
interactionManager.use.stopUsingItem()
|
||||
slotLimiter += { connection.sendPacket(HotbarSlotC2SP(slot)) }
|
||||
connection.fireEvent(SelectHotbarSlotEvent(connection, EventInitiators.CLIENT, slot))
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class InteractionManager(
|
||||
val renderWindow: RenderWindow,
|
||||
) {
|
||||
private val connection = renderWindow.connection
|
||||
val hotbar = HotbarInteractionHandler(renderWindow)
|
||||
val hotbar = HotbarInteractionHandler(renderWindow, this)
|
||||
val pick = ItemPickInteractionHandler(renderWindow, this)
|
||||
val attack = AttackInteractionHandler(renderWindow, this)
|
||||
val `break` = BreakInteractionHandler(renderWindow)
|
||||
|
Loading…
x
Reference in New Issue
Block a user