diff options
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/ItemRegistry.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/ItemRegistry.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/ItemRegistry.java b/src/main/java/me/shedaniel/rei/api/ItemRegistry.java index 1b3b0218b..8751da416 100644 --- a/src/main/java/me/shedaniel/rei/api/ItemRegistry.java +++ b/src/main/java/me/shedaniel/rei/api/ItemRegistry.java @@ -1,3 +1,8 @@ +/* + * Roughly Enough Items by Danielshe. + * Licensed under the MIT License. + */ + package me.shedaniel.rei.api; import net.minecraft.item.Item; @@ -7,12 +12,29 @@ import java.util.List; public interface ItemRegistry { + /** + * Gets the current unmodifiable item list + * + * @return an unmodifiable item list + */ List<ItemStack> getItemList(); + /** + * Gets the current modifiable item list + * + * @return an modifiable item list + */ + @Deprecated List<ItemStack> getModifiableItemList(); ItemStack[] getAllStacksFromItem(Item item); + /** + * Registers an new stack to the item list + * + * @param afterItem + * @param stack the stack to register + */ void registerItemStack(Item afterItem, ItemStack stack); default void registerItemStack(Item afterItem, ItemStack... stacks) { @@ -27,6 +49,12 @@ public interface ItemRegistry { registerItemStack(null, stack); } + /** + * Checks if a stack is already registered + * + * @param stack the stack to check + * @return whether the stack has been registered + */ default boolean alreadyContain(ItemStack stack) { return getItemList().stream().anyMatch(stack1 -> ItemStack.areEqual(stack, stack1)); } |
