Fix ConcurrentModificationException (issue #12 )
This commit is contained in:
@@ -3,7 +3,10 @@ package net.axay.kspigot.extensions.bukkit
|
||||
import org.bukkit.event.inventory.InventoryAction
|
||||
import org.bukkit.inventory.Inventory
|
||||
|
||||
fun Inventory.closeForViewers() = viewers.forEach { it.closeInventory() }
|
||||
/**
|
||||
* Closes the inventory for all viewers.
|
||||
*/
|
||||
fun Inventory.closeForViewers() = HashSet(viewers).forEach { it.closeInventory() }
|
||||
|
||||
/**
|
||||
* @return True, if the action was a simple inventory click.
|
||||
@@ -15,4 +18,4 @@ val InventoryAction.isSimple
|
||||
InventoryAction.PICKUP_ALL, InventoryAction.PICKUP_HALF, InventoryAction.PICKUP_ONE
|
||||
-> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user