Skip to content

Commit

Permalink
Fixed WrappedPlayerInteractEvent call order
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Nov 5, 2022
1 parent dbeecad commit 39752d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nova/src/main/kotlin/xyz/xenondevs/nova/item/ItemListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal object ItemListener : Initializable(), Listener {
registerPacketListener()
}

@EventHandler(priority = EventPriority.LOW)
@EventHandler(priority = EventPriority.NORMAL)
private fun handleInteract(e: WrappedPlayerInteractEvent) {
val event = e.event
val player = event.player
Expand Down Expand Up @@ -96,7 +96,7 @@ internal object ItemListener : Initializable(), Listener {
findBehaviors(equippedItem)?.forEach { it.handleEquip(player, equippedItem!!, true, event) }
}

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
private fun handleInteract(event: InventoryClickEvent) {
val player = event.whoClicked as Player
val clickedItem = event.currentItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal object BlockInteracting : Listener {
registerEvents()
}

@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.LOW)
fun handleInteract(e: WrappedPlayerInteractEvent) {
val event = e.event
if (event.isCompletelyDenied())
Expand Down

0 comments on commit 39752d2

Please sign in to comment.