diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-05-12 10:36:42 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-05-12 10:36:42 +0800 |
| commit | eab120d5619f972e29afc9776959f6d6096d3926 (patch) | |
| tree | 6e33b3cdac62e9bafd18aee65b42ace098c9028a /src/main/java/me/shedaniel/rei/api/ItemRegistry.java | |
| parent | 7e1e39d8453b0a5b5c7c1045fc5e6bb428b840d8 (diff) | |
| download | RoughlyEnoughItems-eab120d5619f972e29afc9776959f6d6096d3926.tar.gz RoughlyEnoughItems-eab120d5619f972e29afc9776959f6d6096d3926.tar.bz2 RoughlyEnoughItems-eab120d5619f972e29afc9776959f6d6096d3926.zip | |
More docs
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/ItemRegistry.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/ItemRegistry.java | 23 |
1 files changed, 23 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 6d8b39d24..8751da416 100644 --- a/src/main/java/me/shedaniel/rei/api/ItemRegistry.java +++ b/src/main/java/me/shedaniel/rei/api/ItemRegistry.java @@ -12,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) { @@ -32,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)); } |
