From 39b9efaa30efa4508a5ab0fdb7bbb0ec0f894340 Mon Sep 17 00:00:00 2001 From: v3ect0rgames <164247766+v3ect0rgames@users.noreply.github.com> Date: Sun, 14 Jul 2024 06:16:17 -0400 Subject: [PATCH] Add Recycling Recipes for GT Parts and Hatches (#797) Adds recycling recipes for some GT parts and hatches. Fixes #780. /* Github Stuff */ [FEATURE] [DETAILS] details = [ "**Adds Recycling Recipes For:**", "LuV+ Parts", "LuV+ Energy Hatches", "4A and 16A Energy Hatches", "Adjustable Transformers", "Substation Hatches", "Laser Hatches", "Misc Batteries", ] [DETAILS] [FIXUP] sha = "226cd449fe4844b2b2c84cebdd6bfaf3cec9a313" newBody = ''' [EXPAND] [[messages]] messageTitle = "Port Tooltips to Groovy (#796)" messageBody = """ [FEATURE] [DETAILS] detail = \"Tooltips are now Localisable!\" [DETAILS] """ [[messages]] messageTitle = "Fix Fluids in JEI (#796)" messageBody = """ [BUG] [DETAILS] details = [ \"Fixes Some Fluids being Items in JEI\", \"Adds Information about Temperature to all Fluids\", ] [DETAILS] """ [EXPAND] ''' [FIXUP] Co-authored-by: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> --- manifest.json | 2 +- .../Main/General/Early-Game/earlygame.groovy | 2 +- .../General/Early-Game/electronics.groovy | 2 +- .../Main/General/Late-Game/lategame.groovy | 2 +- .../Main/General/Mid-Game/midgame.groovy | 2 +- .../General/Misc/recyclingAdditions.groovy | 107 ++++++++++++++++++ .../Mode-Specific/Normal-Mode/buses.groovy | 19 ++-- 7 files changed, 121 insertions(+), 15 deletions(-) create mode 100644 overrides/groovy/postInit/Post-Initial/Main/General/Misc/recyclingAdditions.groovy diff --git a/manifest.json b/manifest.json index 3115fda..52a4233 100644 --- a/manifest.json +++ b/manifest.json @@ -751,7 +751,7 @@ }, { "projectID": 932060, - "fileID": 5525879, + "fileID": 5531121, "required": true }, { diff --git a/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/earlygame.groovy b/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/earlygame.groovy index aad0133..2956e9f 100644 --- a/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/earlygame.groovy +++ b/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/earlygame.groovy @@ -1,6 +1,6 @@ import com.nomiceu.nomilabs.util.LabsModeHelper -import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecipeRecyclingHelpers.* +import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecyclingHelpers.* import static gregtech.api.GTValues.* // Furnaces diff --git a/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/electronics.groovy b/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/electronics.groovy index f442e37..f851f4b 100755 --- a/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/electronics.groovy +++ b/overrides/groovy/postInit/Post-Initial/Main/General/Early-Game/electronics.groovy @@ -1,4 +1,4 @@ -import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecipeRecyclingHelpers.* +import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecyclingHelpers.* // Pyrolyse Oven replaceRecipeInput(metaitem('pyrolyse_oven'), [ diff --git a/overrides/groovy/postInit/Post-Initial/Main/General/Late-Game/lategame.groovy b/overrides/groovy/postInit/Post-Initial/Main/General/Late-Game/lategame.groovy index 6907c71..6e1a336 100755 --- a/overrides/groovy/postInit/Post-Initial/Main/General/Late-Game/lategame.groovy +++ b/overrides/groovy/postInit/Post-Initial/Main/General/Late-Game/lategame.groovy @@ -1,6 +1,6 @@ import com.nomiceu.nomilabs.util.LabsModeHelper -import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecipeRecyclingHelpers.* +import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecyclingHelpers.* import static gregtech.api.GTValues.* if (LabsModeHelper.normal) { diff --git a/overrides/groovy/postInit/Post-Initial/Main/General/Mid-Game/midgame.groovy b/overrides/groovy/postInit/Post-Initial/Main/General/Mid-Game/midgame.groovy index 0eb6ba3..49f87b3 100755 --- a/overrides/groovy/postInit/Post-Initial/Main/General/Mid-Game/midgame.groovy +++ b/overrides/groovy/postInit/Post-Initial/Main/General/Mid-Game/midgame.groovy @@ -1,4 +1,4 @@ -import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecipeRecyclingHelpers.* +import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecyclingHelpers.* // Processing Array replaceRecipeInput(metaitem('processing_array'), diff --git a/overrides/groovy/postInit/Post-Initial/Main/General/Misc/recyclingAdditions.groovy b/overrides/groovy/postInit/Post-Initial/Main/General/Misc/recyclingAdditions.groovy new file mode 100644 index 0000000..e4609d8 --- /dev/null +++ b/overrides/groovy/postInit/Post-Initial/Main/General/Misc/recyclingAdditions.groovy @@ -0,0 +1,107 @@ +import com.nomiceu.nomilabs.util.LabsModeHelper +import gregtech.api.recipes.ingredients.nbtmatch.NBTCondition +import gregtech.api.recipes.ingredients.nbtmatch.NBTMatcher +import gregtech.api.recipes.ingredients.nbtmatch.NBTTagType + +import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecyclingHelpers.* +import static gregtech.api.recipes.RecipeMaps.* + +/* Adds Recycling Recipes to some GT Items */ + +// 4x and 9x Fluid Hatches +// Only add these in Hard Mode, in Normal Mode, these are added in Mode-Specific/Normal-Mode/buses.groovy +if (LabsModeHelper.expert) { + changeStackRecycling(metaitem('fluid_hatch.import_4x'), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem('fluid_hatch.import_4x.iv'), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem('fluid_hatch.import_9x'), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem('fluid_hatch.import_9x.iv'), ASSEMBLER_RECIPES) + + changeStackRecycling(metaitem('fluid_hatch.export_4x'), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem('fluid_hatch.export_4x.iv'), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem('fluid_hatch.export_9x'), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem('fluid_hatch.export_9x.iv'), ASSEMBLER_RECIPES) +} + +// LuV, ZPM and UV Parts +var addRecyclingToParts = { String tier -> + changeStackRecycling(metaitem("electric.motor.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("electric.pump.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("conveyor.module.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("electric.piston.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("robot.arm.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("field.generator.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("emitter.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("sensor.${tier}"), ASSEMBLY_LINE_RECIPES) + changeStackRecycling(metaitem("fluid.regulator.${tier}"), ASSEMBLER_RECIPES) +} + +addRecyclingToParts('luv') +addRecyclingToParts('zpm') +addRecyclingToParts('uv') + +// EV, IV, LuV, ZPM, UV and UHV Misc Energy Hatches + +var addRecyclingToHatches = { String tier -> + changeStackRecycling(metaitem("energy_hatch.input_4a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("energy_hatch.output_4a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("energy_hatch.input_16a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("energy_hatch.output_16a.${tier}"), ASSEMBLER_RECIPES) + + changeStackRecycling(metaitem("transformer.adjustable.${tier}"), ASSEMBLER_RECIPES) + + changeStackRecycling(metaitem("substation_hatch.input_64a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("substation_hatch.output_64a.${tier}"), ASSEMBLER_RECIPES) + + changeStackRecycling(metaitem("laser_hatch.target_256a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("laser_hatch.source_256a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("laser_hatch.target_1024a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("laser_hatch.source_1024a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("laser_hatch.target_4096a.${tier}"), ASSEMBLER_RECIPES) + changeStackRecycling(metaitem("laser_hatch.source_4096a.${tier}"), ASSEMBLER_RECIPES) +} + +// EV Hatches (Just 4A Hatches + Adjustable Transformer) +changeStackRecycling(metaitem('energy_hatch.input_4a.ev'), ASSEMBLER_RECIPES) +changeStackRecycling(metaitem('energy_hatch.output_4a.ev'), ASSEMBLER_RECIPES) +changeStackRecycling(metaitem('transformer.adjustable.ev'), ASSEMBLER_RECIPES) + +addRecyclingToHatches('iv') + +// LuV+: Energy Hatch (2a) Needs Recycling Added +changeStackRecycling(metaitem('energy_hatch.input.luv'), ASSEMBLY_LINE_RECIPES) +changeStackRecycling(metaitem('energy_hatch.output.luv'), ASSEMBLY_LINE_RECIPES) +addRecyclingToHatches('luv') + +changeStackRecycling(metaitem('energy_hatch.input.zpm'), ASSEMBLY_LINE_RECIPES) +changeStackRecycling(metaitem('energy_hatch.output.zpm'), ASSEMBLY_LINE_RECIPES) +addRecyclingToHatches('zpm') + +changeStackRecycling(metaitem('energy_hatch.input.uv'), ASSEMBLY_LINE_RECIPES) +changeStackRecycling(metaitem('energy_hatch.output.uv'), ASSEMBLY_LINE_RECIPES) +addRecyclingToHatches('uv') + +// UHV: Just Energy Input & Output (2a, 4a, 16a), Substation Hatch +changeStackRecycling(metaitem('energy_hatch.input.uhv'), ASSEMBLY_LINE_RECIPES) +changeStackRecycling(metaitem('energy_hatch.output.uhv'), ASSEMBLY_LINE_RECIPES) + +changeStackRecycling(metaitem("energy_hatch.input_4a.uhv"), ASSEMBLER_RECIPES) +changeStackRecycling(metaitem("energy_hatch.output_4a.uhv"), ASSEMBLER_RECIPES) +changeStackRecycling(metaitem("energy_hatch.input_16a.uhv"), ASSEMBLER_RECIPES) +changeStackRecycling(metaitem("energy_hatch.output_16a.uhv"), ASSEMBLER_RECIPES) + +changeStackRecycling(metaitem("substation_hatch.input_64a.uhv"), ASSEMBLER_RECIPES) +changeStackRecycling(metaitem("substation_hatch.output_64a.uhv"), ASSEMBLER_RECIPES) + +// Batteries +NBTCondition charge = NBTCondition.create(NBTTagType.LONG, 'Charge', 0L) + +changeStackRecyclingNBT(metaitem('battery.re.ulv.tantalum'), ASSEMBLER_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) + +changeStackRecyclingNBT(metaitem('energy_crystal'), AUTOCLAVE_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) +changeStackRecyclingNBT(metaitem('lapotron_crystal'), ASSEMBLER_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) + +changeStackRecyclingNBT(metaitem('energy.lapotronic_orb'), CIRCUIT_ASSEMBLER_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) +changeStackRecyclingNBT(metaitem('energy.lapotronic_orb_cluster'), ASSEMBLY_LINE_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) +changeStackRecyclingNBT(metaitem('energy.module'), ASSEMBLY_LINE_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) +changeStackRecyclingNBT(metaitem('energy.cluster'), ASSEMBLY_LINE_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) +changeStackRecyclingNBT(metaitem('max.battery'), ASSEMBLY_LINE_RECIPES, NBTMatcher.NOT_PRESENT_OR_HAS_KEY, charge) diff --git a/overrides/groovy/postInit/Post-Initial/Main/Mode-Specific/Normal-Mode/buses.groovy b/overrides/groovy/postInit/Post-Initial/Main/Mode-Specific/Normal-Mode/buses.groovy index ebe7f3b..18b9c3b 100755 --- a/overrides/groovy/postInit/Post-Initial/Main/Mode-Specific/Normal-Mode/buses.groovy +++ b/overrides/groovy/postInit/Post-Initial/Main/Mode-Specific/Normal-Mode/buses.groovy @@ -1,6 +1,6 @@ import com.nomiceu.nomilabs.util.LabsModeHelper -import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecipeRecyclingHelpers.createRecipe +import static com.nomiceu.nomilabs.groovy.GroovyHelpers.RecyclingHelpers.createRecipe // Changes Buses and Hatches in Normal Mode to not be assembler recipe for first couple tiers. if (!LabsModeHelper.normal) return @@ -76,13 +76,12 @@ mods.gregtech.assembler.removeByOutput([metaitem('fluid_hatch.export_9x')], null mods.gregtech.assembler.removeByOutput([metaitem('fluid_hatch.import_9x.iv')], null, null, null) mods.gregtech.assembler.removeByOutput([metaitem('fluid_hatch.export_9x.iv')], null, null, null) -// No Recycling Recipes for 4x/9x hatches, don't add them -crafting.addShaped(metaitem('fluid_hatch.import_4x'), [[ore('pipeQuadrupleFluidTitanium')], [metaitem('hull.ev')]]) -crafting.addShaped(metaitem('fluid_hatch.import_4x.iv'), [[ore('pipeQuadrupleFluidTungstenSteel')], [metaitem('hull.iv')]]) -crafting.addShaped(metaitem('fluid_hatch.import_9x'), [[ore('pipeNonupleFluidTitanium')], [metaitem('hull.ev')]]) -crafting.addShaped(metaitem('fluid_hatch.import_9x.iv'), [[ore('pipeNonupleFluidTungstenSteel')], [metaitem('hull.iv')]]) +createRecipe(metaitem('fluid_hatch.import_4x'), [[ore('pipeQuadrupleFluidTitanium')], [metaitem('hull.ev')]]) +createRecipe(metaitem('fluid_hatch.import_4x.iv'), [[ore('pipeQuadrupleFluidTungstenSteel')], [metaitem('hull.iv')]]) +createRecipe(metaitem('fluid_hatch.import_9x'), [[ore('pipeNonupleFluidTitanium')], [metaitem('hull.ev')]]) +createRecipe(metaitem('fluid_hatch.import_9x.iv'), [[ore('pipeNonupleFluidTungstenSteel')], [metaitem('hull.iv')]]) -crafting.addShaped(metaitem('fluid_hatch.export_4x'), [[metaitem('hull.ev')], [ore('pipeQuadrupleFluidTitanium')]]) -crafting.addShaped(metaitem('fluid_hatch.export_4x.iv'), [[metaitem('hull.iv')], [ore('pipeQuadrupleFluidTungstenSteel')]]) -crafting.addShaped(metaitem('fluid_hatch.export_9x'), [[metaitem('hull.ev')], [ore('pipeNonupleFluidTitanium')]]) -crafting.addShaped(metaitem('fluid_hatch.export_9x.iv'), [[metaitem('hull.iv')], [ore('pipeNonupleFluidTungstenSteel')]]) +createRecipe(metaitem('fluid_hatch.export_4x'), [[metaitem('hull.ev')], [ore('pipeQuadrupleFluidTitanium')]]) +createRecipe(metaitem('fluid_hatch.export_4x.iv'), [[metaitem('hull.iv')], [ore('pipeQuadrupleFluidTungstenSteel')]]) +createRecipe(metaitem('fluid_hatch.export_9x'), [[metaitem('hull.ev')], [ore('pipeNonupleFluidTitanium')]]) +createRecipe(metaitem('fluid_hatch.export_9x.iv'), [[metaitem('hull.iv')], [ore('pipeNonupleFluidTungstenSteel')]])