Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More GT Multis and some miscellaneous bits #2196

Merged
merged 16 commits into from
Feb 9, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add performant high tier Greenhouse recipes
loving2 committed Jan 3, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit dfada64811a6b2aaf2079630d71e70af6c60220f
120 changes: 97 additions & 23 deletions kubejs/server_scripts/mods/gtceu/greenhouse_recipes.js
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
ServerEvents.recipes(allthemods => {
//////////////// machine controller ////////////////
allthemods.shaped('gtceu:greenhouse', ['AWA', 'ASA', 'WAW'],
{
A: '#gtceu:circuits/mv',
W: 'gtceu:copper_single_cable',
S: 'gtceu:solid_machine_casing'
}).id('gtceu:shaped/greenhouse')
{
A: '#gtceu:circuits/mv',
W: 'gtceu:copper_single_cable',
S: 'gtceu:solid_machine_casing'
}).id('gtceu:shaped/greenhouse')

//////////////// greenhouse recipes ////////////////

@@ -33,8 +33,29 @@ ServerEvents.recipes(allthemods => {
}
}

function grow_max(id, input, output, duration, boostItem, boosted, scale) {
if (boosted) {
allthemods.recipes.gtceu.greenhouse(id)
.circuit(4)
.notConsumable(InputItem.of(input))
.itemInputs(boostItem)
.inputFluids(Fluid.of('minecraft:water', 1000 * scale))
.itemOutputs(output)
.duration(duration / 2)
.EUt(UHV)
} else {
allthemods.recipes.gtceu.greenhouse(id)
.circuit(3)
.notConsumable(InputItem.of(input))
.inputFluids(Fluid.of('minecraft:water', 1000 * scale))
.itemOutputs(output)
.duration(duration)
.EUt(UHV)
}
}

// copy every botany pot recipe into the greenhouse
allthemods.forEachRecipe({type: 'botanypots:crop'}, rawRecipe => {
allthemods.forEachRecipe({ type: 'botanypots:crop' }, rawRecipe => {
let recipe = JSON.parse(rawRecipe.json)
let duration = recipe.growthTicks
let drops = recipe.drops // array of objects { chance, output { item }, minRolls, maxRolls }
@@ -50,17 +71,25 @@ ServerEvents.recipes(allthemods => {
// do nothing because these are duplicate recipes
// console.log("skipping over recipe " + rawRecipe.getId())
} else {
var recipeMAXBuilder = allthemods.recipes.gtceu.greenhouse('kubejs:gtceu/greenhouse/' + affix[0] + "/" + affix[1] + "_max")
var recipeBuilder = allthemods.recipes.gtceu.greenhouse('kubejs:gtceu/greenhouse/' + affix[0] + "/" + affix[1])
recipeBuilder.EUt(MV)
.notConsumable(InputItem.of(input))
.inputFluids(Fluid.of('minecraft:water', 1000))
.duration(duration / 4)
.circuit(0)
drops.forEach( (drop) => {
recipeMAXBuilder.EUt(UHV)
.notConsumable(InputItem.of(input))
.inputFluids(Fluid.of('minecraft:water', 1000 * 1310720))
.duration(duration / 4 * 1024 / 15)
.circuit(5)
drops.forEach((drop) => {
if (drop.hasOwnProperty('maxRolls')) {
recipeBuilder.chancedOutput(Item.of(drop.output.item, drop.maxRolls), drop.chance * 10000, drop.chance * 10000)
recipeMAXBuilder.itemOutputs(Item.of(drop.output.item, drop.maxRolls * 1310720))
} else {
recipeBuilder.chancedOutput(drop.output.item, drop.chance * 10000, drop.chance * 10000)
recipeMAXBuilder.itemOutputs(Item.of(drop.output.item, 1310720))
}
})
}
@@ -69,17 +98,25 @@ ServerEvents.recipes(allthemods => {
// console.log('seed has no item property for recipe ' + rawRecipe.getId())
let input = recipe.seed[1].item
let affix = input.split(':')
var recipeMAXBuilder = allthemods.recipes.gtceu.greenhouse('kubejs:gtceu/greenhouse/' + affix[0] + "/" + affix[1] + "_max")
var recipeBuilder = allthemods.recipes.gtceu.greenhouse('kubejs:gtceu/greenhouse/' + affix[0] + "/" + affix[1])
recipeBuilder.EUt(MV)
.notConsumable(InputItem.of(input))
.inputFluids(Fluid.of('minecraft:water', 1000))
.duration(duration / 4)
.circuit(0)
drops.forEach( (drop) => {
recipeMAXBuilder.EUt(UHV)
.notConsumable(InputItem.of(input))
.inputFluids(Fluid.of('minecraft:water', 1000 * 1310720))
.duration(duration / 4 * 1024 / 15)
.circuit(5)
drops.forEach((drop) => {
if (drop.hasOwnProperty('maxRolls')) {
recipeBuilder.chancedOutput(Item.of(drop.output.item, drop.maxRolls), drop.chance * 10000, drop.chance * 10000)
recipeMAXBuilder.itemOutputs(Item.of(drop.output.item, drop.maxRolls * 1310720))
} else {
recipeBuilder.chancedOutput(drop.output.item, drop.chance * 10000, drop.chance * 10000)
recipeMAXBuilder.itemOutputs(Item.of(drop.output.item, 1310720))
}
})
}
@@ -90,80 +127,95 @@ ServerEvents.recipes(allthemods => {
//////////////// Tiers one and two ////////////////
const infTier = ['air', 'earth', 'water', 'fire', 'inferium', 'stone', 'dirt', 'wood', 'ice']
const prudTier = ['nature', 'dye', 'nether', 'coal', 'coral', 'honey', 'amethyst', 'pig', 'chicken', 'cow', 'sheep', 'squid', 'fish', 'slime',
'turtle', 'rubber', 'silicon', 'sulfur', 'aluminum', 'saltpeter', 'apatite', 'grains_of_infinity', 'mystical_flower', 'limestone', 'menril']
'turtle', 'rubber', 'silicon', 'sulfur', 'aluminum', 'saltpeter', 'apatite', 'grains_of_infinity', 'mystical_flower', 'limestone', 'menril']

infTier.forEach( (base) => {
infTier.forEach((base) => {
let id = 'kubejs:gtceu/greenhouse/mysticalagriculture/' + base
let inp = 'mysticalagriculture:' + base + '_seeds'
let out = 'mysticalagriculture:' + base + '_essence'
let boostOut = '4x mysticalagriculture:' + base + '_essence'
let duration = 9600 / 2
let scale = 163840

grow(id, inp, out, duration, 'minecraft:air', false)
grow(id + '_boosted', inp, boostOut, duration, '4x mysticalagriculture:inferium_essence', true)
grow_max(id + '_max', inp, Item.of(out, scale), duration * 1024 / 120, 'minecraft:air', false, scale)
grow_max(id + '_max_boosted', inp, Item.of(out, scale * 4), duration * 1024 / 120, Item.of('mysticalagriculture:inferium_essence', 4 * scale), true, scale)
})

prudTier.forEach( (base) => {
prudTier.forEach((base) => {
let id = 'kubejs:gtceu/greenhouse/mysticalagriculture/' + base
let inp = 'mysticalagriculture:' + base + '_seeds'
let out = 'mysticalagriculture:' + base + '_essence'
let boostOut = '4x mysticalagriculture:' + base + '_essence'
let duration = 9600 / 2
let scale = 163840

grow(id, inp, out, duration, 'minecraft:air', false)
grow(id + '_boosted', inp, boostOut, duration, '4x mysticalagriculture:prudentium_essence', true)
grow_max(id + '_max', inp, Item.of(out, scale), duration * 1024 / 120, 'minecraft:air', false, scale)
grow_max(id + '_max_boosted', inp, Item.of(out, scale * 4), duration * 1024 / 120, Item.of('mysticalagriculture:prudentium_essence', 4 * scale), true, scale)
})

//////////////// Tiers three and four ////////////////
const tertTier = ['azure_silver', 'crimson_iron', 'iron', 'copper', 'nether_quartz', 'glowstone', 'redstone', 'obsidian', 'prismarine', 'zombie',
'skeleton', 'creeper', 'spider', 'rabbit', 'tin', 'bronze', 'zinc', 'brass', 'silver', 'lead', 'graphite', 'blizz', 'blitz', 'basalz', 'copper_alloy',
'redstone_alloy', 'conductive_alloy', 'manasteel', 'steeleaf', 'ironwood', 'sky_stone', 'certus_quartz', 'quartz_enriched_iron']
'skeleton', 'creeper', 'spider', 'rabbit', 'tin', 'bronze', 'zinc', 'brass', 'silver', 'lead', 'graphite', 'blizz', 'blitz', 'basalz', 'copper_alloy',
'redstone_alloy', 'conductive_alloy', 'manasteel', 'steeleaf', 'ironwood', 'sky_stone', 'certus_quartz', 'quartz_enriched_iron']
const impTier = ['gold', 'lapis_lazuli', 'end', 'experience', 'blaze', 'ghast', 'enderman', 'steel', 'nickel', 'constantan', 'electrum', 'uranium', 'ruby',
'sapphire', 'peridot', 'soulium', 'signalum', 'lumium', 'flux_infused_ingot', 'hop_graphite', 'soularium', 'dark_steel', 'pulsating_alloy',
'energetic_alloy', 'elementium', 'osmium', 'fluorite', 'refined_glowstone', 'refined_obsidian', 'knightmetal', 'fiery_ingot', 'compressed_iron', 'fluix',
'energized_steel', 'blazing_crystal']
'sapphire', 'peridot', 'soulium', 'signalum', 'lumium', 'flux_infused_ingot', 'hop_graphite', 'soularium', 'dark_steel', 'pulsating_alloy',
'energetic_alloy', 'elementium', 'osmium', 'fluorite', 'refined_glowstone', 'refined_obsidian', 'knightmetal', 'fiery_ingot', 'compressed_iron', 'fluix',
'energized_steel', 'blazing_crystal']

tertTier.forEach( (base) => {
tertTier.forEach((base) => {
let id = 'kubejs:gtceu/greenhouse/mysticalagriculture/' + base
let inp = 'mysticalagriculture:' + base + '_seeds'
let out = 'mysticalagriculture:' + base + '_essence'
let boostOut = '4x mysticalagriculture:' + base + '_essence'
let duration = 9600
let scale = 163840

grow(id, inp, out, duration, 'minecraft:air', false)
grow(id + '_boosted', inp, boostOut, duration, '4x mysticalagriculture:tertium_essence', true)
grow_max(id + '_max', inp, Item.of(out, scale), duration * 1024 / 120, 'minecraft:air', false, scale)
grow_max(id + '_max_boosted', inp, Item.of(out, scale * 4), duration * 1024 / 120, Item.of('mysticalagriculture:tertium_essence', 4 * scale), true, scale)
})

impTier.forEach( (base) => {
impTier.forEach((base) => {
let id = 'kubejs:gtceu/greenhouse/mysticalagriculture/' + base
let inp = 'mysticalagriculture:' + base + '_seeds'
let out = 'mysticalagriculture:' + base + '_essence'
let boostOut = '4x mysticalagriculture:' + base + '_essence'
let duration = 9600
let scale = 163840

grow(id, inp, out, duration, 'minecraft:air', false)
grow(id + '_boosted', inp, boostOut, duration, '4x mysticalagriculture:imperium_essence', true)
grow_max(id + '_max', inp, Item.of(out, scale), duration * 1024 / 120, 'minecraft:air', false, scale)
grow_max(id + '_max_boosted', inp, Item.of(out, scale * 4), duration * 1024 / 120, Item.of('mysticalagriculture:imperium_essence', 4 * scale), true, scale)
})

//////////////// Tier five ////////////////
const supTier = ['diamond', 'emerald', 'netherite', 'wither_skeleton', 'platinum', 'enderium', 'flux_infused_gem', 'vibrant_alloy', 'end_steel',
'terrasteel', 'cyanite', 'niotic_crystal', 'spirited_crystal', 'uraninite']
supTier.forEach( (base) => {
'terrasteel', 'cyanite', 'niotic_crystal', 'spirited_crystal', 'uraninite']

supTier.forEach((base) => {
let id = 'kubejs:gtceu/greenhouse/mysticalagriculture/' + base
let inp = 'mysticalagriculture:' + base + '_seeds'
let out = 'mysticalagriculture:' + base + '_essence'
let boostOut = '4x mysticalagriculture:' + base + '_essence'
let duration = 9600 * 3
let scale = 163840

grow(id, inp, out, duration, 'minecraft:air', false)
grow(id + '_boosted', inp, boostOut, duration, '4x mysticalagriculture:supremium_essence', true)
grow_max(id + '_max', inp, Item.of(out, scale), duration * 1024 / 120, 'minecraft:air', false, scale)
grow_max(id + '_max_boosted', inp, Item.of(out, scale * 4), duration * 1024 / 120, Item.of('mysticalagriculture:supremium_essence', 4 * scale), true, scale)
})

//////////////// Tier six ////////////////
const cruxTier = ['nether_star', 'dragon_egg', 'nitro_crystal', 'allthemodium', 'unobtainium', 'vibranium']

cruxTier.forEach( (base) => {
cruxTier.forEach((base) => {
let id = 'kubejs:gtceu/greenhouse/mysticalagriculture/' + base
let inp = 'mysticalagriculture:' + base + '_seeds'
let crux = ''
@@ -175,6 +227,7 @@ ServerEvents.recipes(allthemods => {
let out = 'mysticalagriculture:' + base + '_essence'
let boostOut = '4x mysticalagriculture:' + base + '_essence'
let duration = 9600 * 9
let scale = 163840

allthemods.recipes.gtceu.greenhouse(id)
.circuit(2)
@@ -193,11 +246,32 @@ ServerEvents.recipes(allthemods => {
.itemOutputs(out)
.duration(duration)
.EUt(MV)

allthemods.recipes.gtceu.greenhouse(id + '_max')
.circuit(4)
.notConsumable(InputItem.of(inp))
.notConsumable(InputItem.of(crux))
.itemInputs(Item.of('mysticalagradditions:insanium_essence', 4 * scale))
.inputFluids(Fluid.of('minecraft:water', 1000 * scale))
.itemOutputs(Item.of('mysticalagriculture:' + base + '_essence', 4 * scale))
.duration(duration / 2 * 1024 / 120)
.EUt(UHV)
allthemods.recipes.gtceu.greenhouse(id + '_max_boosted')
.circuit(3)
.notConsumable(InputItem.of(inp))
.notConsumable(InputItem.of(crux))
.inputFluids(Fluid.of('minecraft:water', 1000 * scale))
.itemOutputs(Item.of(out, scale))
.duration(duration * 1024 / 120)
.EUt(UHV)
})

//////////////// GT Rubber trees ////////////////
let scale = 163840
grow('rubber_sapling', 'gtceu:rubber_sapling', ['32x gtceu:rubber_log', '8x gtceu:sticky_resin', '4x gtceu:rubber_sapling'], 9600.0 / 2, 'minecraft:air', false)
grow('rubber_sapling_boosted', 'gtceu:rubber_sapling', ['64x gtceu:rubber_log', '16x gtceu:sticky_resin', '4x gtceu:rubber_sapling'], 9600.0 / 2, '4x gtceu:fertilizer', true)
grow_max('rubber_sapling_max', 'gtceu:rubber_sapling', [Item.of('gtceu:rubber_log', 32 * scale), Item.of('gtceu:sticky_resin', 8 * scale), Item.of('gtceu:rubber_sapling', 2 * scale)], 9600.0 / 2 * 1024 / 120, 'minecraft:air', false, scale)
grow_max('rubber_sapling_max_boosted', 'gtceu:rubber_sapling', [Item.of('gtceu:rubber_log', 64 * scale), Item.of('gtceu:sticky_resin', 16 * scale), Item.of('gtceu:rubber_sapling', 4 * scale)], 9600.0 / 2 * 1024 / 120, Item.of('gtceu:fertilizer', 4 * scale), true, scale)
})

// This File has been authored by AllTheMods Staff, or a Community contributor for use in AllTheMods - AllTheMods 9.