blob: 690ca74dacae9adfecc7ca9c66734cbac047a366 (
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 ItemRegistry {
List<ItemStack> getItemList();
@Deprecated
List<ItemStack> getModifiableItemList();
ItemStack[] getAllStacksFromItem(Item item);
void registerItemStack(Item afterItem, ItemStack stack);
default void registerItemStack(Item afterItem, ItemStack... stacks) {
for(ItemStack stack : stacks)
if (stack != null && !stack.isEmpty())
registerItemStack(afterItem, stack);
}
default 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.areEqual(stack, stack1));
}
}
|