mirror of
https://github.com/chylex/Hardcore-Ender-Expansion-2.git
synced 2025-04-11 03:15:44 +02:00
Add ItemStack.copyIf extension
This commit is contained in:
parent
fe4b3c31c7
commit
309d671d04
@ -12,6 +12,15 @@ inline var ItemStack.size: Int
|
||||
inline val ItemStack.isNotEmpty
|
||||
get() = !isEmpty
|
||||
|
||||
// Copy
|
||||
|
||||
inline fun ItemStack.copyIf(predicate: (ItemStack) -> Boolean): ItemStack{
|
||||
return if (predicate(this))
|
||||
this.copy()
|
||||
else
|
||||
this
|
||||
}
|
||||
|
||||
// Enchantments
|
||||
|
||||
inline val ItemStack.enchantmentMap: Map<Enchantment, Int>
|
||||
|
Loading…
Reference in New Issue
Block a user