diff --git a/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java b/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java index 487f7b9fa..9aebba90a 100644 --- a/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java @@ -25,6 +25,12 @@ public class IndustrialElectrolyzerRecipe extends BaseRecipe { addOutput(output4); } + public IndustrialElectrolyzerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2, + ItemStack output3, ItemStack output4, int tickTime, int euPerTick, boolean oreDict) { + this(inputCells, input2, output1, output2, output3, output4, tickTime, euPerTick); + this.useOreDictionary = oreDict; + } + @Override public String getUserFreindlyName() { return "Industrial Electrolyzer"; diff --git a/src/main/java/techreborn/init/ModFluids.java b/src/main/java/techreborn/init/ModFluids.java index bd81fc9f3..8858dc6fc 100644 --- a/src/main/java/techreborn/init/ModFluids.java +++ b/src/main/java/techreborn/init/ModFluids.java @@ -59,7 +59,7 @@ public class ModFluids { public static Fluid NITROFUEL = new TechRebornFluid("fluidnitrofuel"); public static BlockFluidBase BLOCK_NITROFUEL; - public static Fluid FLUID_NITROGEN = new TechRebornFluid("fluidnitrogen"); + public static Fluid NITROGEN = new TechRebornFluid("fluidnitrogen"); public static BlockFluidBase BLOCK_NITROGEN; public static Fluid NITROGENDIOXIDE = new TechRebornFluid("fluidnitrogendioxide"); @@ -110,6 +110,12 @@ public class ModFluids { public static Fluid SULFURIC_ACID = new TechRebornFluid("fluidsulfuricacid"); public static BlockFluidBase BLOCK_SULFURIC_ACID; + public static Fluid COMPRESSED_AIR = new TechRebornFluid("fluidcompressedair"); + public static BlockFluidBase BLOCK_COMPRESSED_AIR; + + public static Fluid ELECTROLYZED_WATER = new TechRebornFluid("fluidelectrolyzedwater"); + public static BlockFluidBase BLOCK_ELECTROLYZED_WATER; + public static void init() { FluidRegistry.registerFluid(BERYLLIUM); BLOCK_BERYLLIUM = new BlockFluidTechReborn(BERYLLIUM, Material.WATER, "techreborn.berylium"); @@ -191,8 +197,8 @@ public class ModFluids { ModInfo.MOD_ID + "_" + BLOCK_NITROFUEL.getUnlocalizedName().substring(5)); FluidPowerManager.fluidPowerValues.put(NITROFUEL, 42.0); - FluidRegistry.registerFluid(FLUID_NITROGEN); - BLOCK_NITROGEN = new BlockFluidTechReborn(FLUID_NITROGEN, Material.WATER, "techreborn.nitrogen"); + FluidRegistry.registerFluid(NITROGEN); + BLOCK_NITROGEN = new BlockFluidTechReborn(NITROGEN, Material.WATER, "techreborn.nitrogen"); registerBlock(BLOCK_NITROGEN, ModInfo.MOD_ID + "_" + BLOCK_NITROGEN.getUnlocalizedName().substring(5)); @@ -280,6 +286,16 @@ public class ModFluids { BLOCK_SULFURIC_ACID = new BlockFluidTechReborn(SULFURIC_ACID, Material.WATER, "techreborn.sulfuricacid"); registerBlock(BLOCK_SULFURIC_ACID, ModInfo.MOD_ID + "_" + BLOCK_SULFURIC_ACID.getUnlocalizedName().substring(5)); + + FluidRegistry.registerFluid(COMPRESSED_AIR); + BLOCK_COMPRESSED_AIR = new BlockFluidTechReborn(COMPRESSED_AIR, Material.WATER, "techreborn:compressedair"); + registerBlock(BLOCK_COMPRESSED_AIR, + ModInfo.MOD_ID + "_" + BLOCK_COMPRESSED_AIR.getUnlocalizedName().substring(5)); + + FluidRegistry.registerFluid(ELECTROLYZED_WATER); + BLOCK_ELECTROLYZED_WATER = new BlockFluidTechReborn(ELECTROLYZED_WATER, Material.WATER, "techreborn:electrolyzedwater"); + registerBlock(BLOCK_ELECTROLYZED_WATER, + ModInfo.MOD_ID + "_" + BLOCK_ELECTROLYZED_WATER.getUnlocalizedName().substring(5)); } public static void registerBlock(Block block, String name) { diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 78e8e6d0f..4305e69cf 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -76,7 +76,6 @@ public class ModRecipes { addPlateCuttingMachineRecipes(); addIndustrialCentrifugeRecipes(); addChemicalReactorRecipes(); - addIndustrialElectrolyzerRecipes(); addBlastFurnaceRecipes(); addImplosionCompressorRecipes(); @@ -1379,19 +1378,6 @@ public class ModRecipes { new ItemStack(Items.MAGMA_CREAM, 1), 40, 30)); } - static void addIndustrialElectrolyzerRecipes() { - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("nitrocarbon", 2), null, - ItemCells.getCellByName("nitrogen"), ItemCells.getCellByName("carbon"), null, null, 80, 60)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("pyrite", 3), null, - ItemDusts.getDustByName("iron"), ItemDusts.getDustByName("sulfur", 2), null, null, 120, 128)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("sphalerite", 2), null, - ItemDusts.getDustByName("zinc"), ItemDusts.getDustByName("sulfur"), null, null, 150, 100)); - - } - static void addIc2Recipes() { CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.MANUAL), IC2Duplicates.REFINED_IRON.getStackBasedOnConfig(), Items.BOOK); @@ -1805,106 +1791,6 @@ public class ModRecipes { ItemCells.getCellByName("empty"), ItemCells.getCellByName("nitrogenDioxide", 2), 1240, 30)); - // industrialElectrolyzer - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("sulfuricAcid", 7), null, - ItemCells.getCellByName("hydrogen", 2), ItemDusts.getDustByName("sulfur"), - ItemCells.getCellByName("empty", 2), ItemCells.getCellByName("empty", 3), 400, 90)); - - RecipeHandler.addRecipe( - new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("ruby", 9), ItemCells.getCellByName("empty"), - ItemDusts.getDustByName("aluminum", 2), ItemCells.getCellByName("empty", 1), - ItemDusts.getDustByName("chrome", 1), null, 140, 90)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("sapphire", 8), - ItemCells.getCellByName("empty"), ItemDusts.getDustByName("aluminum", 2), - ItemCells.getCellByName("empty"), null, null, 100, 60)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("sodiumSulfide", 2), null, - ItemCells.getCellByName("sodium", 1), ItemDusts.getDustByName("sulfur", 1), null, - ItemCells.getCellByName("empty"), 200, 60)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("peridot", 5), - ItemCells.getCellByName("empty"), ItemDusts.getDustByName("aluminum", 2), - ItemCells.getCellByName("empty"), null, null, 100, 60)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("emerald", 29), - ItemCells.getCellByName("empty", 18), ItemCells.getCellByName("berylium", 3), - ItemDusts.getDustByName("aluminum", 2), ItemCells.getCellByName("silicon", 6), - ItemCells.getCellByName("empty", 9), 520, 120)); - - RecipeHandler.addRecipe( - new IndustrialElectrolyzerRecipe(new ItemStack(Items.DYE, 3, 15), ItemCells.getCellByName("empty", 1), - null, ItemCells.getCellByName("calcium", 1), null, null, 20, 106)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("glyceryl", 20), null, - ItemCells.getCellByName("carbon", 3), ItemCells.getCellByName("hydrogen", 5), - ItemCells.getCellByName("nitrogen", 3), ItemCells.getCellByName("empty", 9), 800, 90)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("peridot", 9), - ItemCells.getCellByName("empty", 4), ItemDusts.getDustByName("magnesium", 2), - ItemDusts.getDustByName("iron"), ItemCells.getCellByName("silicon", 2), - ItemCells.getCellByName("empty", 2), 200, 120)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("calciumCarbonate", 5), null, - ItemCells.getCellByName("carbon"), ItemCells.getCellByName("calcium"), - ItemCells.getCellByName("empty", 1), ItemCells.getCellByName("empty", 2), 400, 90)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("sodiumPersulfate", 6), null, - ItemCells.getCellByName("sodium"), ItemDusts.getDustByName("sulfur"), - ItemCells.getCellByName("empty", 2), ItemCells.getCellByName("empty", 3), 420, 90)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("pyrope", 20), - ItemCells.getCellByName("empty", 9), ItemDusts.getDustByName("aluminum", 2), - ItemDusts.getDustByName("magnesium", 3), ItemCells.getCellByName("silicon", 3), - ItemCells.getCellByName("empty", 6), 400, 120)); - - ItemStack sand = new ItemStack(Blocks.SAND); - sand.setCount(16); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(sand, ItemCells.getCellByName("empty", 2), - ItemCells.getCellByName("silicon", 1), ItemCells.getCellByName("empty"), null, null, 1000, 25)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("almandine", 20), - ItemCells.getCellByName("empty", 9), ItemDusts.getDustByName("aluminum", 2), - ItemDusts.getDustByName("iron", 3), ItemCells.getCellByName("silicon", 3), - ItemCells.getCellByName("empty", 6), 480, 120)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("spessartine", 20), - ItemCells.getCellByName("empty", 9), ItemDusts.getDustByName("aluminum", 2), - ItemDusts.getDustByName("manganese", 3), ItemCells.getCellByName("silicon", 3), - ItemCells.getCellByName("empty", 6), 480, 120)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("andradite", 20), - ItemCells.getCellByName("empty", 12), ItemCells.getCellByName("calcium", 3), - ItemDusts.getDustByName("iron", 2), ItemCells.getCellByName("silicon", 3), - ItemCells.getCellByName("empty", 6), 480, 120)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("grossular", 20), - ItemCells.getCellByName("empty", 12), ItemCells.getCellByName("calcium", 3), - ItemDusts.getDustByName("aluminum", 2), ItemCells.getCellByName("silicon", 3), - ItemCells.getCellByName("empty", 6), 440, 120)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("Uvarovite", 20), - ItemCells.getCellByName("empty", 12), ItemCells.getCellByName("calcium", 3), - ItemDusts.getDustByName("chrome", 2), ItemCells.getCellByName("silicon", 3), - ItemCells.getCellByName("empty", 6), 480, 120)); - - // RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("empty", 6), null, - // ItemCells.getCellByName("hydrogen", 4), ItemCells.getCellByName("empty", 5), - // ItemCells.getCellByName("empty", 1), null, 100, 30)); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("dark_ashes"), - ItemCells.getCellByName("empty", 2), ItemCells.getCellByName("carbon", 2), null, null, null, 20, 30)); - - //Disable recipe for now - // if (OreUtil.doesOreExistAndValid("dustSalt")) { - // ItemStack salt = OreDictionary.getOres("dustSalt").get(0); - // salt.setCount(2); - // RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(salt, ItemCells.getCellByName("empty", 2), - // ItemCells.getCellByName("sodium"), ItemCells.getCellByName("chlorine"), null, null, 40, 60)); - // } - if (ConfigTechReborn.ExpensiveMacerator && !IC2Duplicates.deduplicate()) CraftingHelper .addShapedOreRecipe(getOre("ic2Macerator"), "FDF", "DMD", "FCF", 'F', diff --git a/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java index 73d7b6b26..577e14d22 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java @@ -1,9 +1,12 @@ package techreborn.init.recipes; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import reborncore.api.recipe.RecipeHandler; import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe; import techreborn.items.DynamicCell; +import techreborn.items.ItemCells; import java.security.InvalidParameterException; @@ -12,10 +15,44 @@ import java.security.InvalidParameterException; */ public class IndustrialElectrolyzerRecipes extends RecipeMethods { public static void init() { - register(getOre("dustBauxite", 12), 100, 128, getMaterial("aluminum", 8, Type.DUST), getMaterial("titanium", 2, Type.SMALL_DUST), getMaterial("hydrogen", 5, Type.CELL)); + register(getMaterial("electrolyzedwater", 6, Type.CELL), 760, 120, getMaterial("hydrogen", 4, Type.CELL), getMaterial("compressedair", Type.CELL)); + register(new ItemStack(Items.DYE, 3, 0), 20, 106, false, getMaterial("calcium", Type.CELL)); + register(new ItemStack(Items.SUGAR, 32), 200, 32, getMaterial("carbon", 2, Type.CELL), getMaterial("water", 5, Type.CELL)); + register(new ItemStack(Items.BLAZE_POWDER, 4), 300, 25, getMaterial("dark_ashes", Type.DUST), getMaterial("sulfur", Type.DUST)); + register(new ItemStack(Blocks.SAND, 16), 1000, 25, getMaterial("silicon", Type.CELL), getMaterial("compressedair", Type.CELL)); + register(getOre("dustClay", 8), 200, 50, getMaterial("lithium", Type.CELL), getMaterial("silicon", 2, Type.CELL), getMaterial("aluminum", 2, Type.DUST), getMaterial("sodium", 2, Type.CELL)); + register(getOre("dustCoal"), 40, 50, getMaterial("carbon", 2, Type.CELL)); + register(getOre("dustEnderPearl", 16), 1300, 50, getMaterial("nitrogen", 5, Type.CELL), getMaterial("berylium", 1, Type.CELL), getMaterial("potassium", 4, Type.CELL), getMaterial("chlorite", 6, Type.CELL)); + register(getOre("dustLazurite", 29), 1460, 100, getMaterial("aluminum", 3, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("calcium", 3, Type.CELL), getMaterial("sodium", 4, Type.CELL)); + register(getOre("dustPyrite", 3), 120, 128, getMaterial("iron", Type.DUST), getMaterial("sulfur", 2, Type.DUST)); + register(getOre("dustCalcite", 10), 700, 80, getMaterial("calcium", 2, Type.CELL), getMaterial("carbon", 2, Type.CELL), getMaterial("compressedair", 3, Type.CELL)); + register(getOre("dustSodalite", 23), 1340, 90, getMaterial("sodium", 4, Type.CELL), getMaterial("aluminum", 3, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("chlorite", Type.CELL)); + register(getOre("dustFlint", 8), 1000, 5, getMaterial("silicon", Type.CELL), getMaterial("compressedair", Type.CELL)); + register(getOre("dustSaltpeter", 10), 40, 110, getMaterial("potassium", 2, Type.CELL), getMaterial("nitrogen", 2, Type.CELL), getMaterial("compressedair", 3, Type.CELL)); + register(getOre("dustCinnabar", 2), 100, 128, getMaterial("mercury", Type.CELL), getMaterial("sulfur", Type.DUST)); + register(getOre("dustSphalerite", 2), 140, 100, getMaterial("zinc", Type.DUST), getMaterial("sulfur", Type.DUST)); + register(getOre("dustBauxite", 12), 2000, 128, getMaterial("aluminum", 8, Type.DUST), getMaterial("titanium", 2, Type.SMALL_DUST), getMaterial("hydrogen", 5, Type.CELL), getMaterial("compressedair", 3, Type.CELL)); + register(getOre("dustTungsten"), 20, 50, getMaterial("wolframium", Type.CELL)); + register(getOre("dustRuby", 9), 500, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("chrome", Type.DUST), getMaterial("compressedair", 3, Type.CELL)); + register(getOre("dustSapphire", 8), 400, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("compressedair", 3, Type.CELL)); + register(getOre("dustEmerald", 29), 600, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("berylium", 3, Type.CELL), getMaterial("silicon", 6, Type.CELL), getMaterial("compressedair", 9, Type.CELL)); + register(getOre("dustPeridot", 9), 600, 60, getMaterial("magnesium", 2, Type.DUST), getMaterial("iron", 2, Type.DUST), getMaterial("silicon", Type.CELL), getMaterial("compressedair", 2, Type.CELL)); + register(getOre("dustGalena", 2), 1000, 120, getMaterial("silver", 3, Type.SMALL_DUST), getMaterial("lead", 3, Type.SMALL_DUST), getMaterial("sulfur", 2, Type.SMALL_DUST)); + register(getOre("dustObsidian", 4), 500, 5, getMaterial("magnesium", 2, Type.SMALL_DUST), getMaterial("iron", 2, Type.SMALL_DUST), getMaterial("silicon", Type.CELL), getMaterial("compressedair", 2, Type.CELL)); + register(getOre("dustCharcoal"), 20, 50, getMaterial("carbon", Type.CELL)); + register(getOre("dustPyrope", 20), 1780, 50, getMaterial("magnesium", 3, Type.DUST), getMaterial("aluminum", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL)); + register(getOre("dustAlmandine", 20), 1640, 50, getMaterial("iron", 3, Type.DUST), getMaterial("aluminum", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL)); + register(getOre("dustSpessartine", 20), 1800, 50, getMaterial("aluminum", 2, Type.DUST), getMaterial("manganese", 3, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL)); + register(getOre("dustAndradite", 20), 1280, 50, getMaterial("calcium", 3, Type.CELL), getMaterial("iron", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL)); + register(getOre("dustGrossular", 20), 204, 50, getMaterial("calcium", 3, Type.CELL), getMaterial("aluminum", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL)); + register(getOre("dustUvarovite", 20), 2200, 50, getMaterial("calcium", 3, Type.CELL), getMaterial("chrome", 2, Type.DUST), getMaterial("silicon", 3, Type.CELL), getMaterial("compressedair", 6, Type.CELL)); + register(getOre("dustAshes", 2), 20, 50, getMaterial("carbon", Type.CELL)); + register(getOre("dustCoal"), 40, 50, getMaterial("carbon", 2, Type.CELL)); + register(ItemCells.getCellByName("methane", 5), 140, 50, getMaterial("hydrogen", 4, Type.CELL), getMaterial("carbon", Type.CELL)); + register(ItemCells.getCellByName("sulfuricacid", 7), 40, 100, getMaterial("hydrogen", 2, Type.CELL), getMaterial("sulfur", Type.CELL), getMaterial("compressedair", 2, Type.CELL)); } - static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) { + static void register(ItemStack input, int ticks, int euPerTick, boolean oreDict, ItemStack... outputs) { ItemStack output1; ItemStack output2 = null; ItemStack output3 = null; @@ -44,6 +81,25 @@ public class IndustrialElectrolyzerRecipes extends RecipeMethods { if (stack.getItem() instanceof DynamicCell) { cellCount += stack.getCount(); } + + } + + if (input.getItem() instanceof DynamicCell) { + int inputCount = input.getCount(); + if (cellCount < inputCount) { + if (output2 != null) { + output2 = DynamicCell.getEmptyCell(inputCount - cellCount); + } else if (output3 != null) { + output3 = DynamicCell.getEmptyCell(inputCount - cellCount); + } else if (output4 != null) { + output4 = DynamicCell.getEmptyCell(inputCount - cellCount); + } + } + cellCount -= inputCount; + } + + if (cellCount < 0) { + cellCount = 0; } ItemStack cells = null; @@ -53,6 +109,10 @@ public class IndustrialElectrolyzerRecipes extends RecipeMethods { } cells = DynamicCell.getEmptyCell(cellCount); } - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick)); + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict)); + } + + static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) { + register(input, ticks, euPerTick, true, outputs); } }