Update InventoryExtensions.kt

This commit is contained in:
bluefireoly
2020-10-31 15:11:46 +01:00
parent 08f954e289
commit 28505ec95b

View File

@@ -1,5 +1,14 @@
package net.axay.kspigot.extensions.bukkit
import org.bukkit.event.inventory.InventoryAction
import org.bukkit.inventory.Inventory
fun Inventory.closeForViewers() = viewers.forEach { it.closeInventory() }
fun Inventory.closeForViewers() = viewers.forEach { it.closeInventory() }
val InventoryAction.isSimple
get() = when (this) {
InventoryAction.PLACE_ALL, InventoryAction.PLACE_ONE,
InventoryAction.PICKUP_ALL, InventoryAction.PICKUP_HALF, InventoryAction.PICKUP_ONE
-> true
else -> false
}