Skip to content

Instantly share code, notes, and snippets.

@Choonster
Created February 25, 2015 13:24
Show Gist options
  • Save Choonster/15b35709c49a9489435e to your computer and use it in GitHub Desktop.
Save Choonster/15b35709c49a9489435e to your computer and use it in GitHub Desktop.
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
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment