diff options
author | BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> | 2022-12-29 20:18:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 19:18:22 +0100 |
commit | d50ae9faa2fd16e6cc8d242ef63a555902271ec1 (patch) | |
tree | 7a6bc5f6bbfdd1ea3b66feca5c1400cba325d94d /src/main/java/gregtech/api | |
parent | 7677eecdfe9ea5dc3e6dc9b56f374e9a3fecf46a (diff) | |
download | GT5-Unofficial-d50ae9faa2fd16e6cc8d242ef63a555902271ec1.tar.gz GT5-Unofficial-d50ae9faa2fd16e6cc8d242ef63a555902271ec1.tar.bz2 GT5-Unofficial-d50ae9faa2fd16e6cc8d242ef63a555902271ec1.zip |
Add a way to remove a furnace recipe using the output instead of input (#1609)
* add method
* change method to remove all recipes with said output
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_ModHandler.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 29dec07191..4ec093bdf6 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -1444,6 +1444,20 @@ public class GT_ModHandler { } /** + * Removes all matching Smelting Recipes by output + */ + public static boolean removeFurnaceSmeltingByOutput(ItemStack aOutput) { + if (aOutput != null) { + return FurnaceRecipes.smelting() + .getSmeltingList() + .values() + .removeIf(tOutput -> GT_Utility.isStackValid(tOutput) + && GT_Utility.areStacksEqual(aOutput, (ItemStack) tOutput, true)); + } + return false; + } + + /** * Removes a Crafting Recipe and gives you the former output of it. * * @param aRecipe The content of the Crafting Grid as ItemStackArray with length 9 |