From 3f8391a73eca07d7bf50655c090b8c1ad526850b Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 1 Jan 2024 20:11:38 +0700 Subject: [PATCH] =?UTF-8?q?=D0=95=D0=BC=D0=B0=D0=B5,=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=20=D1=8D=D0=BB=D0=B5=D0=BA=D1=82=D1=80?= =?UTF-8?q?=D0=BE-=D1=82=D0=B5=D0=BF=D0=BB=D0=B8=D1=86=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kubejs/assets/gtceu/lang/en_us.json | 10 +--- kubejs/assets/gtceu/lang/ru_ru.json | 3 ++ kubejs/server_scripts/firmalife/recipes.js | 16 ++++++ kubejs/server_scripts/gregtech/utility.js | 26 +++++++++ kubejs/server_scripts/tfc/recipes.js | 24 +++++++++ kubejs/startup_scripts/firmalife/constants.js | 10 ++++ kubejs/startup_scripts/gtceu/machines.js | 26 +++++++++ kubejs/startup_scripts/gtceu/recipe_types.js | 10 ++++ kubejs/startup_scripts/main_startup_script.js | 16 +++++- kubejs/startup_scripts/tfc/constants.js | 54 ++++++++++++++++++- 10 files changed, 185 insertions(+), 10 deletions(-) create mode 100644 kubejs/startup_scripts/gtceu/machines.js create mode 100644 kubejs/startup_scripts/gtceu/recipe_types.js diff --git a/kubejs/assets/gtceu/lang/en_us.json b/kubejs/assets/gtceu/lang/en_us.json index 1b4f45e70..3a20804c4 100644 --- a/kubejs/assets/gtceu/lang/en_us.json +++ b/kubejs/assets/gtceu/lang/en_us.json @@ -2,12 +2,6 @@ "material.salt_water": "Concentrated Salt Water", "gtceu.jei.bedrock_fluid.salt_water_deposit": "Concentrated Salt Water Deposit", - "block.gtceu.lv_saw_mill": "WIP", - "block.gtceu.mv_saw_mill": "WIP", - "block.gtceu.hv_saw_mill": "WIP", - "block.gtceu.ev_saw_mill": "WIP", - "block.gtceu.iv_saw_mill": "WIP", - "block.gtceu.luv_saw_mill": "WIP", - "block.gtceu.zpm_saw_mill": "WIP", - "block.gtceu.uv_saw_mill": "WIP" + "block.gtceu.greenhouse": "Electric Greenhouse", + "gtceu.greenhouse": "Electric Greenhouse" } \ No newline at end of file diff --git a/kubejs/assets/gtceu/lang/ru_ru.json b/kubejs/assets/gtceu/lang/ru_ru.json index 9269ebf28..94178f7bd 100644 --- a/kubejs/assets/gtceu/lang/ru_ru.json +++ b/kubejs/assets/gtceu/lang/ru_ru.json @@ -2,6 +2,9 @@ "material.salt_water": "Концентрированная соленая вода", "gtceu.jei.bedrock_fluid.salt_water_deposit": "Concentrated Salt Water Deposit", + "block.gtceu.greenhouse": "Электрическая теплица", + "gtceu.greenhouse": "Электрическая теплица", + "behavior.item_magnet.disabled": "§cМагнитное поле выключено", "behavior.item_magnet.enabled": "§aМагнитное поле включено", "behavior.prospector.not_enough_energy": "Не достаточно энергии!", diff --git a/kubejs/server_scripts/firmalife/recipes.js b/kubejs/server_scripts/firmalife/recipes.js index 54202276f..13b058cb7 100644 --- a/kubejs/server_scripts/firmalife/recipes.js +++ b/kubejs/server_scripts/firmalife/recipes.js @@ -63,5 +63,21 @@ const registerFirmaLifeRecipes = (event) => { event.recipes.tfc.anvil('4x firmalife:pie_pan', '#forge:plates/wrought_iron', ["hit_last", "hit_second_last", "draw_third_last"]) .tier(3) .id('firmalife:anvil/pie_pan') + + //#region Рецепты электрической теплицы + + // Дерево + + // Семена фруктов + global.FIRMALIFE_GREENHOUSE_FRUIT_RECIPE_COMPONENTS.forEach(element => { + generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name) + }) + + // Семена ягод + global.FIRMALIFE_GREENHOUSE_BERRY_RECIPE_COMPONENTS.forEach(element => { + generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name) + }) + + //#endregion } \ No newline at end of file diff --git a/kubejs/server_scripts/gregtech/utility.js b/kubejs/server_scripts/gregtech/utility.js index cd2bb0089..f21aee85f 100644 --- a/kubejs/server_scripts/gregtech/utility.js +++ b/kubejs/server_scripts/gregtech/utility.js @@ -54,4 +54,30 @@ const generateCutterRecipe = (event, input, circuit, output, duration, EUt, id) recipe2.circuit(circuit) recipe3.circuit(circuit) } +} + +const generateGreenHouseRecipe = (event, input, fluid_amount, output, id) => { + + // Без удобрения + event.recipes.gtceu.greenhouse(id) + .itemInputs(input) + .circuit(1) + .inputFluids(Fluid.of('minecraft:water', fluid_amount)) + .itemOutputs(output) + .chancedOutput(input, 7500, 0) + .chancedOutput(input, 5000, 0) + .duration(32000) + .EUt(240) + + // С удобрением + event.recipes.gtceu.greenhouse(`${id}_fertilized`) + .itemInputs(input) + .itemInputs('8x gtceu:fertilizer') + .circuit(2) + .inputFluids(Fluid.of('minecraft:water', fluid_amount)) + .itemOutputs(output) + .chancedOutput(input, 8500, 0) + .chancedOutput(input, 6000, 0) + .duration(16000) + .EUt(240) } \ No newline at end of file diff --git a/kubejs/server_scripts/tfc/recipes.js b/kubejs/server_scripts/tfc/recipes.js index df3449c6f..0595dd680 100644 --- a/kubejs/server_scripts/tfc/recipes.js +++ b/kubejs/server_scripts/tfc/recipes.js @@ -2405,6 +2405,30 @@ const registerTFCRecipes = (event) => { //#endregion + //#region Рецепты электрической теплицы + + // Дерево + global.TFC_WOOD_TYPES.forEach(wood => { + generateGreenHouseRecipe(event, `tfc:wood/sapling/${wood}`, 16000, `32x tfc:wood/log/${wood}`, `tfg:greenhouse/${wood}`) + }) + + // Семена фруктов + global.TFC_GREENHOUSE_FRUIT_RECIPE_COMPONENTS.forEach(element => { + generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name) + }) + + // Семена овощей + global.TFC_GREENHOUSE_VEGETABLE_RECIPE_COMPONENTS.forEach(element => { + generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name) + }) + + // Семена ягод + global.TFC_GREENHOUSE_BERRY_RECIPE_COMPONENTS.forEach(element => { + generateGreenHouseRecipe(event, element.input, element.fluid_amount, element.output, element.name) + }) + + //#endregion + // Другое event.remove({ id: `tfc:crafting/trip_hammer` }) event.remove({ id: `tfc:anvil/steel_pump` }) diff --git a/kubejs/startup_scripts/firmalife/constants.js b/kubejs/startup_scripts/firmalife/constants.js index 44f3d1ff8..5e5b36f05 100644 --- a/kubejs/startup_scripts/firmalife/constants.js +++ b/kubejs/startup_scripts/firmalife/constants.js @@ -37,4 +37,14 @@ global.FIRMALIFE_DISABLED_ITEMS = [ global.FIRMALIFE_ORE_MATERIALS = [ 'chromite' +]; + +global.FIRMALIFE_GREENHOUSE_FRUIT_RECIPE_COMPONENTS = [ + { input: 'firmalife:plant/cocoa_sapling', fluid_amount: 8000, output: '3x firmalife:food/cocoa_beans', name: 'cocoa_beans' }, + { input: 'firmalife:plant/fig_sapling', fluid_amount: 8000, output: '3x firmalife:food/fig', name: 'fig' }, +]; + +global.FIRMALIFE_GREENHOUSE_BERRY_RECIPE_COMPONENTS = [ + { input: 'firmalife:plant/pineapple_bush', fluid_amount: 6000, output: '3x firmalife:food/pineapple', name: 'pineapple' }, + { input: 'firmalife:plant/nightshade_bush', fluid_amount: 6000, output: '3x firmalife:food/nightshade_berry', name: 'nightshade' }, ]; \ No newline at end of file diff --git a/kubejs/startup_scripts/gtceu/machines.js b/kubejs/startup_scripts/gtceu/machines.js new file mode 100644 index 000000000..0a2c4767d --- /dev/null +++ b/kubejs/startup_scripts/gtceu/machines.js @@ -0,0 +1,26 @@ +// priority: 0 + +const registerGTCEuMachines = (event) => { + event.create('greenhouse', 'multiblock') + .rotationState(RotationState.NON_Y_AXIS) + .recipeType('greenhouse') + .appearanceBlock(GTBlocks.CASING_STEEL_SOLID) + .pattern(definition => FactoryBlockPattern.start() + .aisle("CCCCCCC", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", " F ") + .aisle("CDDDDDC", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", " XXFXX ") + .aisle("CDDDDDC", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", " XXFXX ") + .aisle("CDDDDDC", "F#####F", "F#####F", "F#####F", "F#####F", "F#####F", "F#####F", "F#####F", "FFFFFFF") + .aisle("CDDDDDC", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", " XXFXX ") + .aisle("CDDDDDC", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", "X#####X", " XXFXX ") + .aisle("CCCYCCC", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", "XXXFXXX", " F ") + .where('X', Predicates.blocks('ae2:quartz_glass')) + .where('F', Predicates.frames('steel')) + .where('D', Predicates.blocks('tfc:dirt/silt').or(Predicates.blocks('tfc:dirt/loam')).or(Predicates.blocks('tfc:dirt/sandy_loam')).or(Predicates.blocks('tfc:dirt/silty_loam')).or(Predicates.blocks('tfc:grass/silt')).or(Predicates.blocks('tfc:grass/loam')).or(Predicates.blocks('tfc:grass/sandy_loam')).or(Predicates.blocks('tfc:grass/silty_loam'))) + .where('C', Predicates.blocks('gtceu:steel_machine_casing').or(Predicates.autoAbilities(definition.getRecipeTypes()))) + .where('#', Predicates.air()) + .where(' ', Predicates.any()) + .where('Y', Predicates.controller(Predicates.blocks(definition.get()))) + .build() + ) + .workableCasingRenderer('gtceu:block/casings/solid/machine_casing_solid_steel', 'gtceu:block/multiblock/implosion_compressor', false) +} \ No newline at end of file diff --git a/kubejs/startup_scripts/gtceu/recipe_types.js b/kubejs/startup_scripts/gtceu/recipe_types.js new file mode 100644 index 000000000..50edee843 --- /dev/null +++ b/kubejs/startup_scripts/gtceu/recipe_types.js @@ -0,0 +1,10 @@ +// priority: 0 + +const registerGTCEuRecipeTypes = (event) => { + event.create('greenhouse') + .category('greenhouse') + .setEUIO('in') + .setMaxIOSize(3, 4, 1, 0) + .setProgressBar(GuiTextures.PROGRESS_BAR_ARROW, FillDirection.LEFT_TO_RIGHT) + .setSound(GTSoundEntries.BATH) +} \ No newline at end of file diff --git a/kubejs/startup_scripts/main_startup_script.js b/kubejs/startup_scripts/main_startup_script.js index c7f2b0ef7..bd4ad0820 100644 --- a/kubejs/startup_scripts/main_startup_script.js +++ b/kubejs/startup_scripts/main_startup_script.js @@ -15,4 +15,18 @@ StartupEvents.registry('block', (event) => {}) /** * Событие регистрации жидкостей. */ -StartupEvents.registry('fluid', (event) => {}) \ No newline at end of file +StartupEvents.registry('fluid', (event) => {}) + +/** + * Событие регистрации типов рецептов. + */ +GTCEuStartupEvents.registry('gtceu:recipe_type', event => { + registerGTCEuRecipeTypes(event) +}) + +/** + * Событие регистрации механизмов. + */ +GTCEuStartupEvents.registry('gtceu:machine', event => { + registerGTCEuMachines(event) +}) \ No newline at end of file diff --git a/kubejs/startup_scripts/tfc/constants.js b/kubejs/startup_scripts/tfc/constants.js index e4bbfffc3..cac0b85c7 100644 --- a/kubejs/startup_scripts/tfc/constants.js +++ b/kubejs/startup_scripts/tfc/constants.js @@ -1619,7 +1619,59 @@ global.TFC_QUERN_FLOUR_RECIPE_COMPONENTS = [ { input: 'tfc:food/wheat_grain', output: '2x tfc:food/wheat_flour', name: 'wheat_flour' }, ]; +global.TFC_GREENHOUSE_FRUIT_RECIPE_COMPONENTS = [ + { input: 'tfc:plant/cherry_sapling', fluid_amount: 8000, output: '3x tfc:food/cherry', name: 'cherry' }, + { input: 'tfc:plant/green_apple_sapling', fluid_amount: 8000, output: '3x tfc:food/green_apple', name: 'green_apple' }, + { input: 'tfc:plant/lemon_sapling', fluid_amount: 8000, output: '3x tfc:food/lemon', name: 'lemon' }, + { input: 'tfc:plant/olive_sapling', fluid_amount: 8000, output: '3x tfc:food/olive', name: 'olive' }, + { input: 'tfc:plant/orange_sapling', fluid_amount: 8000, output: '3x tfc:food/orange', name: 'orange' }, + { input: 'tfc:plant/peach_sapling', fluid_amount: 8000, output: '3x tfc:food/peach', name: 'peach' }, + { input: 'tfc:plant/plum_sapling', fluid_amount: 8000, output: '3x tfc:food/plum', name: 'plum' }, + { input: 'tfc:plant/red_apple_sapling', fluid_amount: 8000, output: '3x tfc:food/red_apple', name: 'red_apple' }, + { input: 'tfc:plant/banana_sapling', fluid_amount:8000, output: '3x tfc:food/banana', name: 'banana' }, +]; + +global.TFC_GREENHOUSE_VEGETABLE_RECIPE_COMPONENTS = [ + { input: 'tfc:seeds/barley', fluid_amount: 4000, output: '3x tfc:food/barley', name: 'barley' }, + { input: 'tfc:seeds/oat', fluid_amount: 4000, output: '3x tfc:food/oat', name: 'oat' }, + { input: 'tfc:seeds/rye', fluid_amount: 4000, output: '3x tfc:food/rye', name: 'rye' }, + { input: 'tfc:seeds/maize', fluid_amount: 4000, output: '3x tfc:food/maize', name: 'maize' }, + { input: 'tfc:seeds/wheat', fluid_amount: 4000, output: '3x tfc:food/wheat', name: 'wheat' }, + { input: 'tfc:seeds/rice', fluid_amount: 4000, output: '3x tfc:food/rice', name: 'rice' }, + { input: 'tfc:seeds/beet', fluid_amount: 4000, output: '3x tfc:food/beet', name: 'beet' }, + { input: 'tfc:seeds/cabbage', fluid_amount: 4000, output: '3x tfc:food/cabbage', name: 'cabbage' }, + { input: 'tfc:seeds/carrot', fluid_amount: 4000, output: '3x tfc:food/carrot', name: 'carrot' }, + { input: 'tfc:seeds/green_bean', fluid_amount: 4000, output: '3x tfc:food/green_bean', name: 'green_bean' }, + { input: 'tfc:seeds/garlic', fluid_amount: 4000, output: '3x tfc:food/garlic', name: 'garlic' }, + { input: 'tfc:seeds/potato', fluid_amount: 4000, output: '3x tfc:food/potato', name: 'potato' }, + { input: 'tfc:seeds/onion', fluid_amount: 4000, output: '3x tfc:food/onion', name: 'onion' }, + { input: 'tfc:seeds/soybean', fluid_amount: 4000, output: '3x tfc:food/soybean', name: 'soybean' }, + { input: 'tfc:seeds/squash', fluid_amount: 4000, output: '3x tfc:food/squash', name: 'squash' }, + { input: 'tfc:seeds/sugarcane', fluid_amount: 4000, output: '3x tfc:food/sugarcane', name: 'sugarcane' }, + { input: 'tfc:seeds/tomato', fluid_amount: 4000, output: '3x tfc:food/tomato', name: 'tomato' }, + { input: 'tfc:seeds/jute', fluid_amount: 4000, output: '3x tfc:jute', name: 'jute' }, + { input: 'tfc:seeds/papyrus', fluid_amount: 4000, output: '3x tfc:papyrus', name: 'papyrus' }, + { input: 'tfc:seeds/pumpkin', fluid_amount: 4000, output: '3x tfc:pumpkin', name: 'pumpkin' }, + { input: 'tfc:seeds/melon', fluid_amount: 4000, output: '3x tfc:melon', name: 'melon' }, + { input: 'tfc:seeds/red_bell_pepper', fluid_amount: 4000, output: '3x tfc:food/red_bell_pepper', name: 'red_bell_pepper' }, + { input: 'tfc:seeds/yellow_bell_pepper', fluid_amount: 4000, output: '3x tfc:food/yellow_bell_pepper', name: 'yellow_bell_pepper' }, +]; + +global.TFC_GREENHOUSE_BERRY_RECIPE_COMPONENTS = [ + { input: 'tfc:plant/snowberry_bush', fluid_amount: 6000, output: '3x tfc:food/snowberry', name: 'snowberry' }, + { input: 'tfc:plant/bunchberry_bush', fluid_amount: 6000, output: '3x tfc:food/bunchberry', name: 'bunchberry' }, + { input: 'tfc:plant/gooseberry_bush', fluid_amount: 6000, output: '3x tfc:food/gooseberry', name: 'gooseberry' }, + { input: 'tfc:plant/cloudberry_bush', fluid_amount: 6000, output: '3x tfc:food/cloudberry', name: 'cloudberry' }, + { input: 'tfc:plant/strawberry_bush', fluid_amount: 6000, output: '3x tfc:food/strawberry', name: 'strawberry' }, + { input: 'tfc:plant/wintergreen_berry_bush', fluid_amount: 6000, output: '3x tfc:food/wintergreen_berry', name: 'wintergreen_berry' }, + { input: 'tfc:plant/blackberry_bush', fluid_amount: 6000, output: '3x tfc:food/blackberry', name: 'blackberry' }, + { input: 'tfc:plant/raspberry_bush', fluid_amount: 6000, output: '3x tfc:food/raspberry', name: 'raspberry' }, + { input: 'tfc:plant/blueberry_bush', fluid_amount: 6000, output: '3x tfc:food/blueberry', name: 'blueberry' }, + { input: 'tfc:plant/elderberry_bush', fluid_amount: 6000, output: '3x tfc:food/elderberry', name: 'elderberry' }, + { input: 'tfc:plant/cranberry_bush', fluid_amount: 6000, output: '3x tfc:food/cranberry', name: 'cranberry' }, +]; + global.calcAmountOfMetal = (defaultAmount, percents) => { const value = defaultAmount / (100 / percents) return (value % 2 == 0) ? value : Math.round(value) - 1 -} +} \ No newline at end of file