Actually fix GUI inventory interaction without messing up click handlers
This commit is contained in:
@@ -19,8 +19,13 @@ object GUIHolder : AutoCloseable {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
listen<InventoryClickEvent> {
|
listen<InventoryClickEvent> {
|
||||||
val clickedInv = it.inventory
|
val clickedInv = it.clickedInventory ?: return@listen
|
||||||
val gui = registered[clickedInv] ?: return@listen
|
val gui = registered[clickedInv] ?: run {
|
||||||
|
if (registered[it.inventory] != null) {
|
||||||
|
it.isCancelled = true
|
||||||
|
}
|
||||||
|
return@listen
|
||||||
|
}
|
||||||
val player = it.playerOrCancel ?: return@listen
|
val player = it.playerOrCancel ?: return@listen
|
||||||
|
|
||||||
if (gui.isInMove) {
|
if (gui.isInMove) {
|
||||||
|
Reference in New Issue
Block a user