InventoryCloseEvent is called twice on AnvilGUIBuilder::open()
woodyn1002 opened this issue · comments
@EventHandler
fun onInventoryClick(event: InventoryClickEvent) {
if (!isCustomGui(event.inventory)) return
if (event.rawSlot == 0) {
val anvilGuiBuilder = createAnvilGuiBuilder()
anvilGuiBuilder.open(event.whoClicked as Player)
}
}
@EventHandler
fun onInventoryClose(event: InventoryCloseEvent) {
println(event)
}
[19:09:36] [Server thread/INFO]: org.bukkit.event.inventory.InventoryCloseEvent@6d7d67f
[19:09:37] [Server thread/INFO]: org.bukkit.event.inventory.InventoryCloseEvent@262b0318
While the player has an inventory opened, AnvilGUIBuilder::open()
calls InventoryCloseEvent
twice.
tested in 1.20.4
Confirm, is the same on 1.21 aswell, it really messes up my plugin logic