Actually fix GUI inventory interaction without messing up click handlers

This commit is contained in:
2024-08-09 08:35:44 -06:00
parent d5e471e576
commit 4e7c6af1ed

View File

@@ -19,8 +19,13 @@ object GUIHolder : AutoCloseable {
init {
listen<InventoryClickEvent> {
val clickedInv = it.inventory
val gui = registered[clickedInv] ?: return@listen
val clickedInv = it.clickedInventory ?: return@listen
val gui = registered[clickedInv] ?: run {
if (registered[it.inventory] != null) {
it.isCancelled = true
}
return@listen
}
val player = it.playerOrCancel ?: return@listen
if (gui.isInMove) {