From f097f00c5532ed1ba61f0c2dbf24389bb1ae8d4e Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sun, 12 Jun 2016 10:28:03 -0400 Subject: [PATCH] Added recipes for all ores -> dust in the alchemy table. --- changelog.txt | 1 + .../bloodmagic/registry/ModRecipes.java | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/changelog.txt b/changelog.txt index 7706908c..92787aac 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Version 2.0.1-43 - Fixed Absorption Hearts remaining after the absorption buff ends for the Steadfast Sentient Sword - Updated the Guide (Woooooooooooooo........) - (Possibly?) fixed Tome of Peritia bug of the Negative Speed of Light +- Added recipes for all ores -> dust in the alchemy table. ------------------------------------------------------ Version 2.0.1-42 diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java b/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java index 71f6d3c1..de94b558 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java @@ -1,5 +1,8 @@ package WayofTime.bloodmagic.registry; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -42,6 +45,8 @@ import com.google.common.base.Stopwatch; public class ModRecipes { + public static ArrayList addedOreRecipeList = new ArrayList(); + public static void init() { RecipeSorter.register(Constants.Mod.DOMAIN + "shapedorb", ShapedBloodOrbRecipe.class, RecipeSorter.Category.SHAPED, "before:minecraft:shapeless"); @@ -54,6 +59,7 @@ public class ModRecipes addAlchemyArrayRecipes(); addSoulForgeRecipes(); addAlchemyTableRecipes(); + addOreDoublingAlchemyRecipes(); } public static void initOreDict() @@ -307,6 +313,13 @@ public class ModRecipes AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(ItemComponent.getStack(ItemComponent.SAND_IRON, 2), 400, 200, 1, "oreIron", ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC))); AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(ItemComponent.getStack(ItemComponent.SAND_GOLD, 2), 400, 200, 1, "oreGold", ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC))); + AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(new ItemStack(Items.REDSTONE, 8), 400, 200, 1, "oreRedstone", ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC))); + + addedOreRecipeList.add("oreIron"); + addedOreRecipeList.add("oreGold"); + addedOreRecipeList.add("oreCoal"); + addedOreRecipeList.add("oreRedstone"); + AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(new ItemStack(Blocks.GRAVEL), 50, 50, 1, "cobblestone", ItemCuttingFluid.getStack(ItemCuttingFluid.EXPLOSIVE))); AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(new ItemStack(Blocks.SAND), 50, 50, 1, Blocks.GRAVEL, ItemCuttingFluid.getStack(ItemCuttingFluid.EXPLOSIVE))); @@ -317,4 +330,25 @@ public class ModRecipes AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableDyeableRecipe(0, 100, 0, new ItemStack(ModItems.sigilHolding))); } + + public static void addOreDoublingAlchemyRecipes() + { + String[] oreList = OreDictionary.getOreNames().clone(); + for (String ore : oreList) + { + if (ore.startsWith("ore") && !addedOreRecipeList.contains(ore)) + { + String dustName = ore.replaceFirst("ore", "dust"); + + List dustList = OreDictionary.getOres(dustName); + if (dustList != null && dustList.size() > 0) + { + ItemStack dustStack = dustList.get(0).copy(); + dustStack.stackSize = 2; + AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(dustStack, 400, 200, 1, ore, ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC))); + addedOreRecipeList.add(ore); + } + } + } + } }