diff --git a/changelog b/changelog index 34c06cd90..b2534b4d8 100644 --- a/changelog +++ b/changelog @@ -14,6 +14,10 @@ * All current nether bedrock ores are tier 1 and do not require any bore fluid * Custom machines now show their recipes in NEI * All it took was battling NEI's source code for 3 hours and my sanity +* The chlorocalcite centrifugation process now requires 8,000mB of sulfuric acid instead of 100mB of water +* Mixed chlorocalcite solution now requires flux as a reducing agent +* All chlorine producing electrolysis recipes have been moved to the electrolysis machine and can no longer be done in the chemical plant + * If only there was a much simpler recipe that may have existed at some point, life could be a dream ## Fixed * Fixed custom machines not sending fluid diff --git a/src/main/java/com/hbm/handler/nei/ElectrolyserFluidHandler.java b/src/main/java/com/hbm/handler/nei/ElectrolyserFluidHandler.java new file mode 100644 index 000000000..11af20db8 --- /dev/null +++ b/src/main/java/com/hbm/handler/nei/ElectrolyserFluidHandler.java @@ -0,0 +1,27 @@ +package com.hbm.handler.nei; + +import java.awt.Rectangle; + +import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.gui.GUIElectrolyserFluid; +import com.hbm.inventory.recipes.ElectrolyserFluidRecipes; + +public class ElectrolyserFluidHandler extends NEIUniversalHandler { + + public ElectrolyserFluidHandler() { + super("Electrolysis", ModBlocks.machine_electrolyser, ElectrolyserFluidRecipes.getRecipes()); + } + + @Override + public String getKey() { + return "ntmElectrolysisFluid"; + } + + @Override + public void loadTransferRects() { + super.loadTransferRects(); + transferRectsGui.add(new RecipeTransferRect(new Rectangle(57, 15, 12, 40), "ntmElectrolysisFluid")); + guiGui.add(GUIElectrolyserFluid.class); + RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui); + } +} diff --git a/src/main/java/com/hbm/handler/nei/ElectrolyserMetalHandler.java b/src/main/java/com/hbm/handler/nei/ElectrolyserMetalHandler.java new file mode 100644 index 000000000..f1d5b6e68 --- /dev/null +++ b/src/main/java/com/hbm/handler/nei/ElectrolyserMetalHandler.java @@ -0,0 +1,27 @@ +package com.hbm.handler.nei; + +import java.awt.Rectangle; + +import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.gui.GUIElectrolyserMetal; +import com.hbm.inventory.recipes.ElectrolyserMetalRecipes; + +public class ElectrolyserMetalHandler extends NEIUniversalHandler { + + public ElectrolyserMetalHandler() { + super("Electrolysis", ModBlocks.machine_electrolyser, ElectrolyserMetalRecipes.getRecipes()); + } + + @Override + public String getKey() { + return "ntmElectrolysisMetal"; + } + + @Override + public void loadTransferRects() { + super.loadTransferRects(); + transferRectsGui.add(new RecipeTransferRect(new Rectangle(2, 35, 22, 25), "ntmElectrolysisMetal")); + guiGui.add(GUIElectrolyserMetal.class); + RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui); + } +} diff --git a/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java b/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java index 62ba87dfa..a8a582fe6 100644 --- a/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java @@ -399,15 +399,8 @@ public class ChemplantRecipes extends SerializableRecipe { .inputFluids(new FluidStack(Fluids.MUSTARDGAS, 4000)) .outputItems(new ItemStack(ModItems.ammo_arty, 1, 11))); recipes.add(new ChemRecipe(101, "CC_CENTRIFUGE", 200) - .inputFluids(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 500), new FluidStack(Fluids.WATER, 1_000)) + .inputFluids(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 500), new FluidStack(Fluids.SULFURIC_ACID, 8_000)) .outputFluids(new FluidStack(Fluids.POTASSIUM_CHLORIDE, 250), new FluidStack(Fluids.CALCIUM_CHLORIDE, 250))); - recipes.add(new ChemRecipe(102, "PC_ELECTROLYSIS", 200) - .inputFluids(new FluidStack(Fluids.POTASSIUM_CHLORIDE, 250)) - .outputItems(new ItemStack(ModItems.dust)) - .outputFluids(new FluidStack(Fluids.CHLORINE, 125))); - recipes.add(new ChemRecipe(103, "CC_ELECTROLYSIS", 200) - .inputFluids(new FluidStack(Fluids.CALCIUM_CHLORIDE, 250)) - .outputFluids(new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125))); } public static void registerFuelProcessing() { diff --git a/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java b/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java index 6eee6ba55..0f783b9f9 100644 --- a/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java @@ -1,7 +1,9 @@ package com.hbm.inventory.recipes; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map.Entry; import com.google.gson.JsonElement; @@ -10,8 +12,10 @@ import com.google.gson.stream.JsonWriter; import com.hbm.inventory.FluidStack; import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemFluidIcon; import net.minecraft.item.ItemStack; @@ -28,6 +32,25 @@ public class ElectrolyserFluidRecipes extends SerializableRecipe { recipes.put(Fluids.CALCIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125))); } + public static HashMap getRecipes() { + + HashMap recipes = new HashMap(); + + for(Entry entry : ElectrolyserFluidRecipes.recipes.entrySet()) { + + ElectrolysisRecipe recipe = entry.getValue(); + FluidStack input = new FluidStack(entry.getKey(), recipe.amount); + List outputs = new ArrayList(); + if(recipe.output1.type != Fluids.NONE) outputs.add(ItemFluidIcon.make(recipe.output1)); + if(recipe.output2.type != Fluids.NONE) outputs.add(ItemFluidIcon.make(recipe.output2)); + for(ItemStack byproduct : recipe.byproduct) outputs.add(byproduct); + + recipes.put(new ComparableStack(ItemFluidIcon.make(input)), outputs.toArray()); + } + + return recipes; + } + @Override public String getFileName() { return "hbmElectrolyzerFluid.json"; diff --git a/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java b/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java index d5d3fe492..781d7a1da 100644 --- a/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java @@ -1,6 +1,7 @@ package com.hbm.inventory.recipes; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; @@ -12,11 +13,14 @@ import com.google.gson.stream.JsonWriter; import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.RecipesCommon.OreDictStack; +import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.material.MaterialShapes; import com.hbm.inventory.material.Mats; import com.hbm.inventory.material.Mats.MaterialStack; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemFluidIcon; +import com.hbm.items.machine.ItemScraps; import com.hbm.util.ItemStackUtil; import net.minecraft.item.ItemStack; @@ -55,6 +59,25 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe { return null; } + public static HashMap getRecipes() { + + HashMap recipes = new HashMap(); + + for(Entry entry : ElectrolyserMetalRecipes.recipes.entrySet()) { + + ElectrolysisMetalRecipe recipe = entry.getValue(); + Object[] input = new Object[] { entry.getKey().copy(), new ComparableStack(ItemFluidIcon.make(Fluids.NITRIC_ACID, 100)) }; + List outputs = new ArrayList(); + if(recipe.output1 != null) outputs.add(ItemScraps.create(recipe.output1, true)); + if(recipe.output2 != null) outputs.add(ItemScraps.create(recipe.output2, true)); + for(ItemStack byproduct : recipe.byproduct) outputs.add(byproduct); + + recipes.put(input, outputs.toArray()); + } + + return recipes; + } + @Override public String getFileName() { return "hbmElectrolyzerMetal.json"; diff --git a/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java b/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java index 0a68397d6..d47d2289c 100644 --- a/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/MixerRecipes.java @@ -79,7 +79,7 @@ public class MixerRecipes extends SerializableRecipe { register(Fluids.CHLOROCALCITE_SOLUTION, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.WATER, 250)).setStack2(new FluidStack(Fluids.NITRIC_ACID, 250)).setSolid(new OreDictStack(CHLOROCALCITE.dust()))); - register(Fluids.CHLOROCALCITE_MIX, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.CHLOROCALCITE_SOLUTION, 500)).setStack2(new FluidStack(Fluids.SULFURIC_ACID, 500))); + register(Fluids.CHLOROCALCITE_MIX, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.CHLOROCALCITE_SOLUTION, 500)).setStack2(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new ComparableStack(ModItems.powder_flux))); } public static void register(FluidType type, MixerRecipe... rec) { diff --git a/src/main/java/com/hbm/main/NEIConfig.java b/src/main/java/com/hbm/main/NEIConfig.java index c5bc758a2..7ce0ffd04 100644 --- a/src/main/java/com/hbm/main/NEIConfig.java +++ b/src/main/java/com/hbm/main/NEIConfig.java @@ -73,6 +73,8 @@ public class NEIConfig implements IConfigureNEI { registerHandler(new SawmillHandler()); registerHandler(new MixerHandler()); registerHandler(new OutgasserHandler()); + registerHandler(new ElectrolyserFluidHandler()); + registerHandler(new ElectrolyserMetalHandler()); for(MachineConfiguration conf : CustomMachineConfigJSON.niceList) registerHandlerBypass(new CustomMachineHandler(conf));