jakobkmar / KSpigot

Extended Spigot and Bukkit API for Kotlin
https://jakobkmar.github.io/KSpigot
GNU General Public License v3.0
134 stars 35 forks source link

Fix unregistering the wrong GUI on InventoryCloseEvent #69

Closed xNoobyyy closed 1 month ago

xNoobyyy commented 1 month ago

Previously, only the onClose callback checked if the inventory closed was the correct one. However, it called deleteInstance on every InventoryCloseEvent, which caused an issue with GUIPageBuilder#changeGUI (#64). This was because the InventoryCloseEvent was triggered after the GUI changed, leading to the unregistration of the newly opened GUI instead of the old one.

(also removed an unused import in KColors)