Update GUI.kt
This commit is contained in:
@@ -217,8 +217,16 @@ class GUIInstance<T : ForInventory>(
|
|||||||
* Stops KSpigot from listening to actions in this
|
* Stops KSpigot from listening to actions in this
|
||||||
* GUI anymore.
|
* GUI anymore.
|
||||||
*/
|
*/
|
||||||
|
fun unregister() {
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
fun unregister() = GUIHolder.unregister(this as GUIInstance<ForInventory>)
|
GUIHolder.unregister(this as GUIInstance<ForInventory>)
|
||||||
|
|
||||||
|
// unregister this inv from all elements
|
||||||
|
currentElements.forEach { it.stopUsing(this) }
|
||||||
|
currentElements.clear()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return True, if the [inventory] belongs to this GUI.
|
* @return True, if the [inventory] belongs to this GUI.
|
||||||
|
Reference in New Issue
Block a user