diff options
author | Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> | 2023-02-14 15:21:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 15:21:59 +0000 |
commit | 258efe3ad0a0340b1cf6a2e8657c65a1d9c73f3d (patch) | |
tree | cfd32ad37d89ca625f5fff0c891b233e20bc7149 /src/main/java/com | |
parent | 552e013e72c00e78e35e7f5cfb909076517a2e50 (diff) | |
download | GT5-Unofficial-258efe3ad0a0340b1cf6a2e8657c65a1d9c73f3d.tar.gz GT5-Unofficial-258efe3ad0a0340b1cf6a2e8657c65a1d9c73f3d.tar.bz2 GT5-Unofficial-258efe3ad0a0340b1cf6a2e8657c65a1d9c73f3d.zip |
Add recipes for MHDCSM parts (#282)
* New EIC file with magneto recipes
* Save state
* Redo the logic to work better.
* Spotless
* spotlessApply (#283)
Co-authored-by: GitHub GTNH Actions <>
* Add multiplier to reduce cost of MHDCSM parts.
* Spotless
* Add some fodder
---------
Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Former-commit-id: a84d71976069c3bc1c9f8d3c62cc6c65f840ef19
Diffstat (limited to 'src/main/java/com')
2 files changed, 151 insertions, 68 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java new file mode 100644 index 0000000000..fefd6fce54 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ElectricImplosionCompressorRecipes.java @@ -0,0 +1,146 @@ +package com.github.bartimaeusnek.bartworks.common.loaders; + +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.util.GT_ModHandler.getModItem; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.*; +import gregtech.api.util.GT_OreDictUnificator; + +public class ElectricImplosionCompressorRecipes implements Runnable { + + private static void addElectricImplosionRecipe(final ItemStack[] inputItems, final FluidStack[] inputFluids, + final ItemStack[] outputItems, final FluidStack[] outputFluids, final int durationInTicks, + final int EUPerTick) { + eicMap.addRecipe( + false, + inputItems, + outputItems, + null, + inputFluids, + outputFluids, + durationInTicks, + EUPerTick, + 1); + } + + private static final ItemStack[] circuits = new ItemStack[] { ItemList.Circuit_ExoticProcessor.get(1), + ItemList.Circuit_OpticalAssembly.get(1), ItemList.Circuit_Biowaresupercomputer.get(1), + ItemList.Circuit_Wetwaremainframe.get(1) }; + + @Override + public void run() { + // Custom electric implosion compressor recipes. Cannot be overclocked. + + if (Loader.isModLoaded("eternalsingularity")) { + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, + // OUT. + new ItemStack[] { getModItem("eternalsingularity", "eternal_singularity", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 100 * 20, + (int) TierEU.RECIPE_UMV); + } + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L) }, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + // OUT. + new ItemStack[] { getModItem("GoodGenerator", "highDensityPlutonium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { getModItem("GoodGenerator", "highDensityUraniumNugget", 5L) }, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + // OUT. + new ItemStack[] { getModItem("GoodGenerator", "highDensityUranium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); + + addElectricImplosionRecipe( + // IN. + new ItemStack[] { getModItem("GoodGenerator", "highDensityThoriumNugget", 5L) }, + new FluidStack[] { Materials.Infinity.getMolten(9L) }, + // OUT. + new ItemStack[] { getModItem("GoodGenerator", "highDensityThorium", 1L) }, + new FluidStack[] { GT_Values.NF }, + // Recipe stats. + 1, + (int) TierEU.RECIPE_UEV); + + // Magneto material recipe for base fluid. + addElectricImplosionRecipe( + // IN. + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.WhiteDwarfMatter, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.Universium, 1L), + GT_OreDictUnificator.get(OrePrefixes.nanite, Materials.BlackDwarfMatter, 1L) }, + new FluidStack[] { Materials.RawStarMatter.getFluid(16 * 144L) }, + // OUT. + new ItemStack[] { GT_Values.NI }, + new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter.getMolten(4 * 144L) }, + // Recipe stats. + 20 * 4, + (int) TierEU.RECIPE_UXV); + + addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes(); + } + + private void addMagnetohydrodynamicallyConstrainedStarMatterPartRecipes() { + + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.frameGt, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.nugget, 9, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ingot, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plate, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.plateDense, 1, 3); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stick, 2, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.round, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.bolt, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.screw, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.ring, 4, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.foil, 8, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.itemCasing, 2, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGtSmall, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.rotor, 1, 2); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.stickLong, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.springSmall, 2, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.spring, 1, 1); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.gearGt, 1, 2); + addWhiteDwarfMagnetoEICRecipe(OrePrefixes.wireFine, 8, 1); + } + + private void addWhiteDwarfMagnetoEICRecipe(final OrePrefixes part, final int multiplier, + final int circuitMultiplier) { + + final int partFraction = (int) (144 * part.mMaterialAmount / M); + + for (ItemStack circuit : circuits) { + addElectricImplosionRecipe( + new ItemStack[] { circuit.splitStack(circuitMultiplier), + getModItem("supersolarpanel", "solarsplitter", 1, 0), + getModItem("OpenComputers", "hologram2", circuitMultiplier, 0), + GT_OreDictUnificator.get(part, Materials.Universium, multiplier), }, + new FluidStack[] { Materials.MagnetohydrodynamicallyConstrainedStarMatter + .getMolten((long) partFraction * multiplier) }, + new ItemStack[] { GT_OreDictUnificator + .get(part, Materials.MagnetohydrodynamicallyConstrainedStarMatter, multiplier) }, + new FluidStack[] { GT_Values.NF }, + (int) (multiplier * (20 * partFraction / 144.0)), + (int) TierEU.RECIPE_UXV); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 8ffe956261..fe73bc18f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -42,7 +42,6 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.google.common.collect.ArrayListMultimap; import com.gtnewhorizons.modularui.common.widget.ProgressBar; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import gnu.trove.map.hash.TObjectDoubleHashMap; import gregtech.api.enums.*; @@ -317,7 +316,7 @@ public class StaticRecipeChangeLoaders { /** * Constructs a list of recipes to change by scanning all EBF recipes for uses of noble gases. - * + * * @param GasTags list of gas tags to look out for in EBF recipes * @return A multimap from the gas tag (noble and/or anaerobic) to all the recipes containing a gas with that tag */ @@ -343,7 +342,7 @@ public class StaticRecipeChangeLoaders { /** * Scans EBF recipes for no-gas variants of the recipes present in base. Adds these recipes to the base multimap. - * + * * @param base The recipe multimap to scan and modify * @return Set of item outputs (recipe.mOutputs[0]) of the no-gas recipes */ @@ -602,7 +601,7 @@ public class StaticRecipeChangeLoaders { "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", - 2, + 6, 2, 0, 0, @@ -625,73 +624,11 @@ public class StaticRecipeChangeLoaders { 1, BW_Util.getMachineVoltageFromTier(10), 0)); - } - - // Custom electric implosion compressor recipe. Cannot be overclocked. - if (Loader.isModLoaded("eternalsingularity")) { - - // 72L SpaceTime -> 1 Eternal singularity. - eicMap.addRecipe( - false, - new ItemStack[] { GT_Values.NI }, - new ItemStack[] { GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L) }, - null, - new FluidStack[] { Materials.SpaceTime.getMolten(72L) }, - new FluidStack[] { GT_Values.NF }, - 100 * 20, - 128_000_000, - 1); // aSpecialVaue has no meaning here. - } - if (Loader.isModLoaded("universalsingularities")) { - - // Raw Exposed Optical Chip - eicMap.addRecipe( - false, - new ItemStack[] { ItemList.Circuit_Silicon_Wafer7.get(1L), - GT_ModHandler - .getModItem("universalsingularities", "universal.general.singularity", 1L, 20) }, - new ItemStack[] { ItemList.Circuit_Chip_Optical.get(16L) }, - null, - new FluidStack[] { GT_Values.NF }, - new FluidStack[] { GT_Values.NF }, - 5 * 20, - 125_829_120, - 1); + // Custom EIC recipes. + new ElectricImplosionCompressorRecipes().run(); } - eicMap.addRecipe( - false, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutoniumNugget", 5L) }, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityPlutonium", 1L) }, - null, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, - new FluidStack[] { GT_Values.NF }, - 1, - 7_864_320, - 1); - - eicMap.addRecipe( - false, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityUraniumNugget", 5L) }, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityUranium", 1L) }, - null, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, - new FluidStack[] { GT_Values.NF }, - 1, - 7_864_320, - 1); - - eicMap.addRecipe( - false, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityThoriumNugget", 5L) }, - new ItemStack[] { GT_ModHandler.getModItem("GoodGenerator", "highDensityThorium", 1L) }, - null, - new FluidStack[] { Materials.Infinity.getMolten(9L) }, - new FluidStack[] { GT_Values.NF }, - 1, - 7_864_320, - 1); } private static boolean checkForExplosives(ItemStack input) { |