diff options
| author | Elisis <gtandemmodding@gmail.com> | 2022-11-01 02:56:11 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-31 16:56:11 +0100 |
| commit | 0093be04e46484d89f1c55eaee4d83e50833ca5e (patch) | |
| tree | ced12e4bf135260b401719526837ee70da5637a4 /src | |
| parent | 2652f4b051c37a280f132602eda4ab4c4f39a15a (diff) | |
| download | GT5-Unofficial-0093be04e46484d89f1c55eaee4d83e50833ca5e.tar.gz GT5-Unofficial-0093be04e46484d89f1c55eaee4d83e50833ca5e.tar.bz2 GT5-Unofficial-0093be04e46484d89f1c55eaee4d83e50833ca5e.zip | |
Werkstoff Fluid Solidifier Recipe Generation (#228)
* Add options to autogenerate fluid solidifier recipes for a werkstoff material, remove pre-existing hardcoded gear, bolt, rotor, ring solidifier recipe generation
* spotlessApply (#229)
Co-authored-by: Elisis <gtandemmodding@gmail.com>
Co-authored-by: GitHub GTNH Actions <>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Former-commit-id: 59a66065becb404415651f8d59b3ee851b6b563c
Diffstat (limited to 'src')
3 files changed, 145 insertions, 25 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 6d1a7ace26..a0c5e63ef3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -832,6 +832,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Auto add MetalWorking(crafting components) Recipe 10000 */ public byte extraRecipes; + + /* + * Here so that new recipes don't fuck with existing functionality + * Auto add Crafting Metal Solidifier recipes 1 + * Auto add Meta Crafting Metal Solidifier recipes 10 + * Auto add Multiple Ingot Metal Solidifier recipes 100 (Unused) + */ + public byte extraRecipes2; + public short mixCircuit = -1; public Werkstoff.GenerationFeatures setBlacklist(OrePrefixes p) { @@ -886,6 +895,33 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.extraRecipes & 1) != 0; } + public Werkstoff.GenerationFeatures addMetalCraftingSolidifierRecipes() { + this.extraRecipes2 = (byte) (this.extraRecipes2 | 1); + return this; + } + + public boolean hasMetalCraftingSolidifierRecipes() { + return (this.extraRecipes2 & 1) != 0; + } + + public Werkstoff.GenerationFeatures addMetaSolidifierRecipes() { + this.extraRecipes2 = (byte) (this.extraRecipes2 | 10); + return this; + } + + public boolean hasMetaSolidifierRecipes() { + return (this.extraRecipes2 & 10) != 0; + } + + public Werkstoff.GenerationFeatures addMultipleMetalSolidifierRecipes() { + this.extraRecipes2 = (byte) (this.extraRecipes2 | 100); + return this; + } + + public boolean hasMultipleMetalSolidifierRecipes() { + return (this.extraRecipes2 & 100) != 0; + } + public Werkstoff.GenerationFeatures addMixerRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 10); return this; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 55bbb89e52..9abca71e18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -162,32 +162,36 @@ public class CraftingMaterialLoader implements IWerkstoffRunnable { // molten -> metal if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { + + /* !! No more hardcoded gear, etc. recipe gen, now must go through GenerationFeatures() !! + GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear_Small.get(0L), - werkstoff.getMolten(144), - werkstoff.get(gearGtSmall), - 16, - 8); - if (WerkstoffLoader.ringMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.ringMold.get(0L), - werkstoff.getMolten(36), - werkstoff.get(ring), - 100, - 4 * tVoltageMultiplier); - if (WerkstoffLoader.boltMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.boltMold.get(0L), - werkstoff.getMolten(18), - werkstoff.get(bolt), - 50, - 2 * tVoltageMultiplier); - - if (WerkstoffLoader.rotorMold != null) - GT_Values.RA.addFluidSolidifierRecipe( - WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear_Small.get(0L), + werkstoff.getMolten(144), + werkstoff.get(gearGtSmall), + 16, + 8); + if (WerkstoffLoader.ringMold != null) + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.ringMold.get(0L), + werkstoff.getMolten(36), + werkstoff.get(ring), + 100, + 4 * tVoltageMultiplier); + if (WerkstoffLoader.boltMold != null) + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.boltMold.get(0L), + werkstoff.getMolten(18), + werkstoff.get(bolt), + 50, + 2 * tVoltageMultiplier); + + if (WerkstoffLoader.rotorMold != null) + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + */ } GT_Values.RA.addPulveriserRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 153f131383..a54f15fcd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -131,6 +131,86 @@ public class MoltenCellLoader implements IWerkstoffRunnable { werkstoff.getStats().getMass() > 128 ? 64 : 30); } + if (werkstoff.getGenerationFeatures().hasMetalCraftingSolidifierRecipes()) { + + if (!werkstoff.hasItemType(plate)) return; + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Rod_Long.get(0), + werkstoff.getMolten(144), + werkstoff.get(stickLong), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Rod.get(0), + werkstoff.getMolten(72), + werkstoff.get(stick), + (int) Math.max(werkstoff.getStats().getMass() / 2, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Plate.get(0), + werkstoff.getMolten(144), + werkstoff.get(plate), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + + if (werkstoff.getGenerationFeatures().hasMetaSolidifierRecipes()) { + if (!werkstoff.hasItemType(screw)) return; + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Screw.get(0), + werkstoff.getMolten(18), + werkstoff.get(screw), + (int) Math.max(werkstoff.getStats().getMass() / 8, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear.get(0), + werkstoff.getMolten(576), + werkstoff.get(gearGt), + (int) Math.max(werkstoff.getStats().getMass() / 4, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear_Small.get(0), + werkstoff.getMolten(144), + werkstoff.get(gearGtSmall), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Bolt.get(0), + werkstoff.getMolten(18), + werkstoff.get(bolt), + (int) Math.max(werkstoff.getStats().getMass() / 8, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Ring.get(0), + werkstoff.getMolten(36), + werkstoff.get(ring), + (int) Math.max(werkstoff.getStats().getMass() / 4, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + + // No Spring Molds + + if (WerkstoffLoader.rotorMold == null) return; + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Rotor.get(0), + werkstoff.getMolten(612), + werkstoff.get(rotor), + (int) Math.max(werkstoff.getStats().getMass() * 4.25, 1L), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + } + + if (werkstoff.getGenerationFeatures().hasMultipleMetalSolidifierRecipes()) { + if (!werkstoff.hasItemType(plateDouble)) return; + // No multiple plate molds + } + // Tank "Recipe" final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), |
