Skip to content

Commit

Permalink
fix crash on furnace recipe removal
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Aug 9, 2021
1 parent 932be0f commit a65bbaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/recipes/GTRecipeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static <R extends RecipeBuilder<R>> 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;
}
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/gregtech/api/recipes/ModHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit a65bbaa

Please sign in to comment.