diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 19:02:00 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 19:02:00 +0800 |
| commit | ad7f945d6f724d51ee843b334838fda84c6197f2 (patch) | |
| tree | b67cd5a1b95826435ef54813e4221ff3fda39212 /src/main/java/me/shedaniel/rei/api/RecipeHelper.java | |
| parent | 9f5a9eae9a7863412cc5eb433bf15e5ee71da616 (diff) | |
| download | RoughlyEnoughItems-ad7f945d6f724d51ee843b334838fda84c6197f2.tar.gz RoughlyEnoughItems-ad7f945d6f724d51ee843b334838fda84c6197f2.tar.bz2 RoughlyEnoughItems-ad7f945d6f724d51ee843b334838fda84c6197f2.zip | |
API Changes
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/RecipeHelper.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/RecipeHelper.java | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java index 9c66a6eb4..30915a794 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java @@ -7,14 +7,11 @@ package me.shedaniel.rei.api; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.RoughlyEnoughItemsCore; -import me.shedaniel.rei.api.annotations.ToBeRemoved; import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen; -import net.minecraft.item.ItemStack; import net.minecraft.recipe.Recipe; import net.minecraft.recipe.RecipeManager; import net.minecraft.util.Identifier; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -50,24 +47,9 @@ public interface RecipeHelper { * Gets all craftable items from materials. * * @param inventoryItems the materials - * @return the list of craftable items - */ - default List<ItemStack> findCraftableByItems(List<ItemStack> inventoryItems) { - List<ItemStack> itemStacks = new ArrayList<>(); - for (EntryStack item : findCraftableEntriesByItems(inventoryItems)) { - if (item.getItemStack() != null) - itemStacks.add(item.getItemStack()); - } - return itemStacks; - } - - /** - * Gets all craftable items from materials. - * - * @param inventoryItems the materials * @return the list of craftable entries */ - List<EntryStack> findCraftableEntriesByItems(List<ItemStack> inventoryItems); + List<EntryStack> findCraftableEntriesByItems(List<EntryStack> inventoryItems); /** * Registers a category @@ -82,7 +64,7 @@ public interface RecipeHelper { * @param category the category * @param workingStations the working stations */ - void registerWorkingStations(Identifier category, List<ItemStack>... workingStations); + void registerWorkingStations(Identifier category, List<EntryStack>... workingStations); /** * Registers the working stations of a category @@ -90,9 +72,9 @@ public interface RecipeHelper { * @param category the category * @param workingStations the working stations */ - void registerWorkingStations(Identifier category, ItemStack... workingStations); + void registerWorkingStations(Identifier category, EntryStack... workingStations); - List<List<ItemStack>> getWorkingStations(Identifier category); + List<List<EntryStack>> getWorkingStations(Identifier category); /** * Registers a recipe display @@ -103,19 +85,13 @@ public interface RecipeHelper { void registerDisplay(Identifier categoryIdentifier, RecipeDisplay display); /** - * Gets a map of recipes for an itemstack + * Gets a map of recipes for an entry * * @param stack the stack to be crafted * @return the map of recipes */ Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(EntryStack stack); - @ToBeRemoved - @Deprecated - default Map<RecipeCategory<?>, List<RecipeDisplay>> getRecipesFor(ItemStack stack) { - return getRecipesFor(EntryStack.create(stack)); - } - RecipeCategory getCategory(Identifier identifier); /** @@ -133,19 +109,13 @@ public interface RecipeHelper { List<RecipeCategory> getAllCategories(); /** - * Gets a map of usages for an itemstack + * Gets a map of usages for an entry * * @param stack the stack to be used * @return the map of recipes */ Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(EntryStack stack); - @ToBeRemoved - @Deprecated - default Map<RecipeCategory<?>, List<RecipeDisplay>> getUsagesFor(ItemStack stack) { - return getUsagesFor(EntryStack.create(stack)); - } - /** * Gets the optional of the speed crafting button area from a category * |
