Add ListExtensions
This commit is contained in:
parent
e3c2d1c18d
commit
b216102bb9
|
@ -0,0 +1,15 @@
|
|||
package net.shadowfacts.forgelin.extensions
|
||||
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
/**
|
||||
* @author shadowfacts
|
||||
*/
|
||||
fun List<ItemStack>.containsStack(stack: ItemStack): Boolean {
|
||||
forEach {
|
||||
if (it.item == stack.item && it.itemDamage == stack.itemDamage) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
Loading…
Reference in New Issue