diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-05-12 18:10:15 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-05-12 18:10:15 +0800 |
| commit | a98d9191f1a97925a8a3e2e23c0a07867540a93a (patch) | |
| tree | 8aac9df58b40052b6b19c0c3ac7da66076dc5b1c /src/main/java/me/shedaniel/rei/api/RecipeHelper.java | |
| parent | 45ed37cc8d0088b57cd2605482f471e69e5885f4 (diff) | |
| download | RoughlyEnoughItems-a98d9191f1a97925a8a3e2e23c0a07867540a93a.tar.gz RoughlyEnoughItems-a98d9191f1a97925a8a3e2e23c0a07867540a93a.tar.bz2 RoughlyEnoughItems-a98d9191f1a97925a8a3e2e23c0a07867540a93a.zip | |
Out of beta: Build 110
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/RecipeHelper.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/RecipeHelper.java | 91 |
1 files changed, 90 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java index 58d67e97a..acb844e2e 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java @@ -24,10 +24,24 @@ public interface RecipeHelper { return RoughlyEnoughItemsCore.getRecipeHelper(); } + /** + * Gets the total recipe count registered + * + * @return the recipe count + */ int getRecipeCount(); - List<Recipe> getVanillaSortedRecipes(); + /** + * @return a list of sorted recipes + */ + List<Recipe> getAllSortedRecipes(); + /** + * Gets all craftable items from materials. + * + * @param inventoryItems the materials + * @return the list of craftable items + */ List<ItemStack> findCraftableByItems(List<ItemStack> inventoryItems); /** @@ -45,6 +59,12 @@ public interface RecipeHelper { */ void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display); + /** + * Gets a map of recipes for an itemstack + * + * @param stack the stack to be crafted + * @return the map of recipes + */ Map<RecipeCategory, List<RecipeDisplay>> getRecipesFor(ItemStack stack); /** @@ -56,32 +76,101 @@ public interface RecipeHelper { /** * Gets all registered categories + * * @return the list of categories */ List<RecipeCategory> getAllCategories(); + /** + * Gets a map of usages for an itemstack + * + * @param stack the stack to be used + * @return the map of recipes + */ Map<RecipeCategory, List<RecipeDisplay>> getUsagesFor(ItemStack stack); + /** + * Gets the optional of the speed crafting button area from a category + * + * @param category the category of the display + * @return the optional of speed crafting button area + */ Optional<ButtonAreaSupplier> getSpeedCraftButtonArea(RecipeCategory category); + /** + * Registers a speed crafting button area + * + * @param category the category of the button area + * @param rectangle the button area + */ void registerSpeedCraftButtonArea(Identifier category, ButtonAreaSupplier rectangle); + /** + * Registers a default speed crafting button area, which is bottom right + * + * @param category the category of the button area + */ void registerDefaultSpeedCraftButtonArea(Identifier category); + /** + * Gets the speed crafting functional from a category + * + * @param category the category of the speed crafting functional + * @return the list of speed crafting functionals + */ List<SpeedCraftFunctional> getSpeedCraftFunctional(RecipeCategory category); + /** + * Registers a speed crafting functional + * + * @param category the category of the speed crafting functional + * @param functional the functional to be registered + */ void registerSpeedCraftFunctional(Identifier category, SpeedCraftFunctional functional); + /** + * Gets the map of all recipes visible to the player + * + * @return the map of recipes + */ Map<RecipeCategory, List<RecipeDisplay>> getAllRecipes(); + /** + * Registers a recipe visibility handler + * + * @param visibilityHandler the handler to be registered + */ void registerRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler); + /** + * Unregisters a recipe visibility handler + * + * @param visibilityHandler the handler to be unregistered + */ void unregisterRecipeVisibilityHandler(DisplayVisibilityHandler visibilityHandler); + /** + * Gets an unmodifiable list of recipe visibility handlers + * + * @return the unmodifiable list of handlers + */ List<DisplayVisibilityHandler> getDisplayVisibilityHandlers(); + /** + * Checks if the display is visible by asking recipe visibility handlers + * + * @param display the display to be checked + * @param respectConfig whether it should respect the user's config + * @return whether the display should be visible + */ boolean isDisplayVisible(RecipeDisplay display, boolean respectConfig); + /** + * Gets the cached category setting by the category identifier + * + * @param category the identifier of the category + * @return the optional of the category settings + */ Optional<DisplaySettings> getCachedCategorySettings(Identifier category); } |
