Skip to content

Instantly share code, notes, and snippets.

@Choonster
Choonster / RecipeRemoverFurnaceSnippet.java
Created February 25, 2015 13:24
Minecraft Forge 1.7.10-10.13.2.1236 - Method to remove all furnace recipes that result in the specified ItemStack.
public static void removeFurnaceRecipe (ItemStack resultItem)
{
Map<ItemStack, ItemStack> recipes = FurnaceRecipes.smelting().getSmeltingList();
for (Iterator<Map.Entry<ItemStack,ItemStack>> entries = recipes.entrySet().iterator(); entries.hasNext(); ){
Map.Entry<ItemStack,ItemStack> entry = entries.next();
ItemStack result = entry.getValue();
if (ItemStack.areItemStacksEqual(result, resultItem)){ // If the output matches the specified ItemStack,
entries.remove(); // Remove the recipe
}
}