From d50ae9faa2fd16e6cc8d242ef63a555902271ec1 Mon Sep 17 00:00:00 2001 From: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Date: Thu, 29 Dec 2022 20:18:22 +0200 Subject: 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 --- src/main/java/gregtech/api/util/GT_ModHandler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/main/java/gregtech/api/util') 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 @@ -1443,6 +1443,20 @@ public class GT_ModHandler { return false; } + /** + * 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. * -- cgit