blob: f397b15c0f9c8a691e6168cd7cc97637153a6984 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package me.shedaniel.rei.api;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.List;
public interface IItemRegisterer {
public List<ItemStack> getItemList();
@Deprecated
public List<ItemStack> getModifiableItemList();
public ItemStack[] getAllStacksFromItem(Item item);
public void registerItemStack(Item afterItem, ItemStack stack);
default public void registerItemStack(Item afterItem, ItemStack... stacks) {
for(ItemStack stack : stacks)
if (stack != null && !stack.isEmpty())
registerItemStack(afterItem, stack);
}
default public void registerItemStack(ItemStack... stacks) {
for(ItemStack stack : stacks)
if (stack != null && !stack.isEmpty())
registerItemStack(null, stack);
}
default boolean alreadyContain(ItemStack stack) {
return getItemList().stream().anyMatch(stack1 -> ItemStack.areItemStacksEqual(stack, stack1));
}
}
|