From e804a8a9dd7e4092dfe0b019e5ac586c0ec331ee Mon Sep 17 00:00:00 2001 From: Pyritie Date: Mon, 28 Jul 2025 21:04:10 +0100 Subject: [PATCH] added fluid parameter to the greenhouse recipe builder --- kubejs/server_scripts/ad_astra/recipes.js | 8 ++++++-- kubejs/server_scripts/beneath/recipes.js | 8 ++++++-- kubejs/server_scripts/firmalife/recipes.js | 6 ++++-- kubejs/server_scripts/gregtech/utility.js | 10 +++++----- kubejs/server_scripts/tfc/recipes.js | 18 ++++++++++++------ kubejs/server_scripts/tfg/recipes.space.js | 3 ++- 6 files changed, 35 insertions(+), 18 deletions(-) diff --git a/kubejs/server_scripts/ad_astra/recipes.js b/kubejs/server_scripts/ad_astra/recipes.js index 450b7dd63..1788dc199 100644 --- a/kubejs/server_scripts/ad_astra/recipes.js +++ b/kubejs/server_scripts/ad_astra/recipes.js @@ -809,8 +809,12 @@ const registerAdAstraRecipes = (event) => { }).id('tfg:shaped/strophar_ladder') - generateGreenHouseRecipe(event, '8x ad_astra:strophar_mushroom', 16000, '64x ad_astra:strophar_stem', 'tfg:green_house/strophar_mushroom', 'ad_astra:mars', 8, '16x ad_astra:strophar_cap', GTValues.VA[GTValues.MV]) - generateGreenHouseRecipe(event, '8x ad_astra:aeronos_mushroom', 16000, '64x ad_astra:aeronos_stem', 'tfg:green_house/aeronos_mushroom', 'ad_astra:mars', 8, '16x ad_astra:aeronos_cap', GTValues.VA[GTValues.MV]) + generateGreenHouseRecipe(event, '8x ad_astra:strophar_mushroom', 'tfg:semiheavy_ammoniacal_water', 16000, + '64x ad_astra:strophar_stem', 'tfg:green_house/strophar_mushroom', 'ad_astra:mars', 8, + '16x ad_astra:strophar_cap', GTValues.VA[GTValues.MV]) + generateGreenHouseRecipe(event, '8x ad_astra:aeronos_mushroom', 'tfg:semiheavy_ammoniacal_water', 16000, + '64x ad_astra:aeronos_stem', 'tfg:green_house/aeronos_mushroom', 'ad_astra:mars', 8, + '16x ad_astra:aeronos_cap', GTValues.VA[GTValues.MV]) // TODO: needs a sapling //generateGreenHouseRecipe(event, '8x ___', 16000, '64x ad_astra:glacian_log', 'tfg:green_house/glacian_tree', 'ad_astra:mars', 8, '8x species:alphacene_moss_block', GTValues.VA[GTValues.MV]) //#endregion diff --git a/kubejs/server_scripts/beneath/recipes.js b/kubejs/server_scripts/beneath/recipes.js index 9e835ad4c..ba88c6d55 100644 --- a/kubejs/server_scripts/beneath/recipes.js +++ b/kubejs/server_scripts/beneath/recipes.js @@ -54,6 +54,10 @@ const registerBeneathRecipes = (event) => { event.recipes.tfc.landslide('beneath:soul_clay', 'beneath:soul_clay') - generateGreenHouseRecipe(event, '8x minecraft:warped_fungus', 16000, '64x beneath:wood/log/warped', 'tfg:green_house/warped_fungus', 'ad_astra:mars', 8, '16x minecraft:warped_wart_block', GTValues.VA[GTValues.MV]) - generateGreenHouseRecipe(event, '8x minecraft:crimson_fungus', 16000, '64x beneath:wood/log/crimson', 'tfg:green_house/crimson_fungus', 'ad_astra:mars', 8, '16x minecraft:nether_wart_block', GTValues.VA[GTValues.MV]) + generateGreenHouseRecipe(event, '8x minecraft:warped_fungus', 'tfg:semiheavy_ammoniacal_water', 16000, + '64x beneath:wood/log/warped', 'tfg:green_house/warped_fungus', 'ad_astra:mars', 8, + '16x minecraft:warped_wart_block', GTValues.VA[GTValues.MV]) + generateGreenHouseRecipe(event, '8x minecraft:crimson_fungus', 'tfg:semiheavy_ammoniacal_water', 16000, + '64x beneath:wood/log/crimson', 'tfg:green_house/crimson_fungus', 'ad_astra:mars', 8, + '16x minecraft:nether_wart_block', GTValues.VA[GTValues.MV]) } \ No newline at end of file diff --git a/kubejs/server_scripts/firmalife/recipes.js b/kubejs/server_scripts/firmalife/recipes.js index 568fb0091..1c3173f25 100644 --- a/kubejs/server_scripts/firmalife/recipes.js +++ b/kubejs/server_scripts/firmalife/recipes.js @@ -468,12 +468,14 @@ const registerFirmaLifeRecipes = (event) => { // Семена фруктов global.FIRMALIFE_GREENHOUSE_FRUIT_RECIPE_COMPONENTS.forEach(element => { - generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name, 'minecraft:overworld', 8, null, GTValues.VA[GTValues.LV]) + generateGreenHouseRecipe(event, element.input, '#tfg:clean_water', element.fluid_amount, element.output, + element.name, 'minecraft:overworld', 8, null, GTValues.VA[GTValues.LV]) }) // Семена ягод global.FIRMALIFE_GREENHOUSE_BERRY_RECIPE_COMPONENTS.forEach(element => { - generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name, null, 8, null, GTValues.VA[GTValues.LV]) + generateGreenHouseRecipe(event, element.input, '#tfg:clean_water', element.fluid_amount, element.output, + element.name, null, 8, null, GTValues.VA[GTValues.LV]) }) //#endregion diff --git a/kubejs/server_scripts/gregtech/utility.js b/kubejs/server_scripts/gregtech/utility.js index 1a9e5cda7..1fb378d10 100644 --- a/kubejs/server_scripts/gregtech/utility.js +++ b/kubejs/server_scripts/gregtech/utility.js @@ -62,7 +62,8 @@ const generateCutterRecipe = (event, input, output, duration, EUt, id) => { * * @param {*} event * @param {string} input -Item (Not consumed) - * @param {number} fluid_amount -mB (uses #tfg:clean_water) + * @param {string} fluid -Fluid ID or tag + * @param {number} fluid_amount -Fluid amount, in mB * @param {string} output -Item (Chanced output uses input item) * @param {string} id -Recipe ID * @param {string} dimension -Dimension ID @@ -70,21 +71,20 @@ const generateCutterRecipe = (event, input, output, duration, EUt, id) => { * @param {string|null} output_seconday -Item (Optional, if there should be a third output) * @param {number} EUt */ -function generateGreenHouseRecipe(event, input, fluid_amount, output, id, dimension, fertiliser_count, output_secondary, EUt) { +function generateGreenHouseRecipe(event, input, fluid, fluid_amount, output, id, dimension, fertiliser_count, output_secondary, EUt) { if (EUt === undefined || output_secondary === undefined || fertiliser_count === undefined || dimension === undefined) { throw new TypeError(`Call to generateGreenHouseRecipe for id ${id} is missing args`); } let r = event.recipes.gtceu.greenhouse(id) .notConsumable(input) .circuit(1) - .inputFluids(`#tfg:clean_water ${fluid_amount}`) + .inputFluids(`${fluid} ${fluid_amount}`) .itemOutputs(output) .chancedOutput(input, 750, 0) .chancedOutput(input, 500, 0) .duration(36000) // 30 mins .EUt(EUt) - if (dimension !== null) r.dimension(dimension) if (output_secondary !== null) @@ -96,7 +96,7 @@ function generateGreenHouseRecipe(event, input, fluid_amount, output, id, dimens .notConsumable(input) .itemInputs(Item.of('gtceu:fertilizer', fertiliser_count)) .circuit(2) - .inputFluids(`#tfg:clean_water ${fluid_amount}`) + .inputFluids(`${fluid} ${fluid_amount}`) .itemOutputs(output) .chancedOutput(input, 4000, 0) .chancedOutput(input, 3000, 0) diff --git a/kubejs/server_scripts/tfc/recipes.js b/kubejs/server_scripts/tfc/recipes.js index 2a8b97ec1..b91c6dcf4 100644 --- a/kubejs/server_scripts/tfc/recipes.js +++ b/kubejs/server_scripts/tfc/recipes.js @@ -57,26 +57,31 @@ const registerTFCRecipes = (event) => { // Дерево global.TFC_WOOD_TYPES.forEach(wood => { - generateGreenHouseRecipe(event, `8x tfc:wood/sapling/${wood}`, 16000, `64x tfc:wood/log/${wood}`, `tfg:greenhouse/${wood}`, 'minecraft:overworld', 16, null, GTValues.VA[GTValues.MV]) + generateGreenHouseRecipe(event, `8x tfc:wood/sapling/${wood}`, '#tfg:clean_water', 16000, `64x tfc:wood/log/${wood}`, + `tfg:greenhouse/${wood}`, 'minecraft:overworld', 16, null, GTValues.VA[GTValues.MV]) }) global.AFC_SAPLINGS.forEach(x => { - generateGreenHouseRecipe(event, `8x afc:wood/sapling/${x.sapling}`, 16000, `64x ${x.log}`, `tfg:greenhouse/${x.sapling}`, 'minecraft:overworld', 16, null, GTValues.VA[GTValues.MV]) + generateGreenHouseRecipe(event, `8x afc:wood/sapling/${x.sapling}`, '#tfg:clean_water', 16000, `64x ${x.log}`, + `tfg:greenhouse/${x.sapling}`, 'minecraft:overworld', 16, null, GTValues.VA[GTValues.MV]) }) // Семена фруктов global.TFC_GREENHOUSE_FRUIT_RECIPE_COMPONENTS.forEach(element => { - generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name, 'minecraft:overworld', 8, null, GTValues.VA[GTValues.LV]) + generateGreenHouseRecipe(event, element.input, '#tfg:clean_water', element.fluid_amount, element.output, + element.name, 'minecraft:overworld', 8, null, GTValues.VA[GTValues.LV]) }) // Семена овощей global.TFC_GREENHOUSE_VEGETABLE_RECIPE_COMPONENTS.forEach(element => { - generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name, null, 8, null, GTValues.VA[GTValues.LV]) + generateGreenHouseRecipe(event, element.input, '#tfg:clean_water', element.fluid_amount, element.output, + element.name, null, 8, null, GTValues.VA[GTValues.LV]) }) // Семена ягод global.TFC_GREENHOUSE_BERRY_RECIPE_COMPONENTS.forEach(element => { - generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name, null, 8, null, GTValues.VA[GTValues.LV]) + generateGreenHouseRecipe(event, element.input, '#tfg:clean_water', element.fluid_amount, element.output, + element.name, null, 8, null, GTValues.VA[GTValues.LV]) }) // Растения @@ -84,7 +89,8 @@ const registerTFCRecipes = (event) => { const itemId = element.id; const recipeId = `greenhouse_${itemId.replace(':', '_')}`; - generateGreenHouseRecipe(event, itemId, 8000, `8x ${itemId}`, recipeId, null, 8, null, GTValues.VA[GTValues.LV]); + generateGreenHouseRecipe(event, itemId, '#tfg:clean_water', 8000, `8x ${itemId}`, + recipeId, null, 8, null, GTValues.VA[GTValues.LV]); }); //#endregion diff --git a/kubejs/server_scripts/tfg/recipes.space.js b/kubejs/server_scripts/tfg/recipes.space.js index 8b1d279e3..78d37fd9f 100644 --- a/kubejs/server_scripts/tfg/recipes.space.js +++ b/kubejs/server_scripts/tfg/recipes.space.js @@ -140,7 +140,8 @@ function registerTFGSpaceRecipes(event) { .addDataString("fluidA", "tfc:salt_water") .outputFluids(Fluid.of("tfc:salt_water", 1000)) - // Plants + // Plants - Can't use the default builder here because fertiliser is much harder to get on the moon, + // and we're using helium-3 as the fertiliser // Chorus event.recipes.gtceu.greenhouse('tfg:chorus')