We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10a07ba commit 7e85921Copy full SHA for 7e85921
1 file changed
invui-kotlin/src/main/kotlin/xyz/xenondevs/invui/inventory/InventoryExtensions.kt
@@ -24,4 +24,11 @@ operator fun Inventory.plusAssign(item: ItemStack) {
24
/**
25
* Checks if the [Inventory] contains an [ItemStack] similar to the given [item].
26
*/
27
-operator fun Inventory.contains(item: ItemStack) = containsSimilar(item)
+operator fun Inventory.contains(item: ItemStack): Boolean =
28
+ containsSimilar(item)
29
+
30
+/**
31
+ * Creates an [ObscuredInventory] of only the slots in the given [range].
32
+ */
33
+operator fun Inventory.get(range: IntRange): ObscuredInventory =
34
+ ObscuredInventory(this) { it !in range }
0 commit comments