From a65bbaa4ba779a428061b520498a4fab97e22dce Mon Sep 17 00:00:00 2001 From: DStrand1 Date: Sun, 8 Aug 2021 22:05:16 -0500 Subject: [PATCH] fix crash on furnace recipe removal --- src/main/java/gregtech/api/recipes/GTRecipeHandler.java | 2 +- src/main/java/gregtech/api/recipes/ModHandler.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/api/recipes/GTRecipeHandler.java b/src/main/java/gregtech/api/recipes/GTRecipeHandler.java index e9a5a2d0c08..dce2d14f0e3 100644 --- a/src/main/java/gregtech/api/recipes/GTRecipeHandler.java +++ b/src/main/java/gregtech/api/recipes/GTRecipeHandler.java @@ -59,7 +59,7 @@ public static > boolean removeRecipesByInputs(RecipeM if (ConfigHolder.debug) { if (wasRemoved) GTLog.logger.info("Removed Recipe for inputs: Items: {} Fluids: {}", itemNames, fluidNames); - else GTLog.logger.info("Failed to Remove Recipe for inputs: Items: {} Fluids: {}", itemNames, fluidNames); + else GTLog.logger.error("Failed to Remove Recipe for inputs: Items: {} Fluids: {}", itemNames, fluidNames); } return wasRemoved; } diff --git a/src/main/java/gregtech/api/recipes/ModHandler.java b/src/main/java/gregtech/api/recipes/ModHandler.java index bb727fc249a..41f9723e234 100644 --- a/src/main/java/gregtech/api/recipes/ModHandler.java +++ b/src/main/java/gregtech/api/recipes/ModHandler.java @@ -485,14 +485,15 @@ public static boolean removeFurnaceSmelting(ItemStack input) { if (ItemStack.areItemStacksEqual(input, stack)) { FurnaceRecipes.instance().getSmeltingList().remove(stack); wasRemoved = true; + break; } } if (ConfigHolder.debug) { if (wasRemoved) GTLog.logger.info("Removed Smelting Recipe for Input: {}", input.getDisplayName()); - else GTLog.logger.warn("Failed to Remove Smelting Recipe for Input: {}", input.getDisplayName()); + else GTLog.logger.error("Failed to Remove Smelting Recipe for Input: {}", input.getDisplayName()); } - + return wasRemoved; } @@ -502,7 +503,7 @@ public static int removeRecipes(ItemStack output) { if (ConfigHolder.debug) { if (recipesRemoved != 0) GTLog.logger.info("Removed {} Recipe(s) with Output: {}", recipesRemoved, output.getDisplayName()); - else GTLog.logger.warn("Failed to Remove Recipe with Output: {}", output.getDisplayName()); + else GTLog.logger.error("Failed to Remove Recipe with Output: {}", output.getDisplayName()); } return recipesRemoved; } @@ -536,7 +537,7 @@ public static void removeRecipeByName(ResourceLocation location) { String recipeName = location.toString(); if (ForgeRegistries.RECIPES.containsKey(location)) GTLog.logger.info("Removed Recipe with Name: {}", recipeName); - else GTLog.logger.warn("Failed to Remove Recipe with Name: {}", recipeName); + else GTLog.logger.error("Failed to Remove Recipe with Name: {}", recipeName); } ForgeRegistries.RECIPES.register(new DummyRecipe().setRegistryName(location)); }