Fix unregistering the wrong GUI on InventoryCloseEvent (#69)
* fix unregistering the wrong gui
* removed unused import
* fix indentation
(cherry picked from commit 35c4c77869)
This commit is contained in:
@@ -99,7 +99,9 @@ class GUIIndividual<T : ForInventory>(
|
||||
init {
|
||||
if (resetOnClose || data.onClose != null) {
|
||||
listen<InventoryCloseEvent> {
|
||||
if (data.onClose != null && playerInstances[it.player]?.bukkitInventory == it.inventory) {
|
||||
if (playerInstances[it.player]?.bukkitInventory != it.inventory) return@listen
|
||||
|
||||
if (data.onClose != null) {
|
||||
data.onClose.invoke(GUICloseEvent(it, playerInstances[it.player]!!, it.player as Player))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user