Files
malloc-s4/kubejs/server_scripts/mods/croptopia.js

54 lines
2.0 KiB
JavaScript
Executable File

ServerEvents.recipes(event => {
let jamFruits = ['apricot', 'blackberry', 'blueberry', 'cherry', 'elderberry', 'grape', 'peach', 'raspberry', 'straberry'];
jamFruits.forEach(fruit => {
event.replaceInput({output: `croptopia:${fruit}_jam`}, 'minecraft:glass_bottle', 'thermal:jar');
});
event.custom({
type: "thermal:press",
ingredients: [
{ tag: 'forge:peanuts', count: 3},
{ item: "croptopia:food_press" }
],
result: ["croptopia:peanut_butter"]
});
let saplingTag = Ingredient.of("#forge:saplings");
saplingTag.getStacks().toArray().forEach(sapling => {
let saplingID = sapling.getId().split(':');
let fruitOutput = saplingID[1].split('_')[0];
let outputTag = Ingredient.of(`#forge:crops/${fruitOutput}`).getStacks().toArray()[0].getId();
console.log("Insolating " + outputTag + " from " + sapling);
event.recipes.thermal.insolator(outputTag, sapling).water(400);
// forge:crops/pear
});
event.recipes.thermal.bottler('croptopia:steamed_rice', [Fluid.of("minecraft:water", 50), '#forge:grain/rice']);
let _ = ['pizza', 'supreme_pizza', 'cheese_pizza', 'pineapple_pepperoni_pizza', 'anchovy_pizza'].forEach(pizza => {
event.replaceInput(
{output: `croptopia:${pizza}`},
'#forge:tomatoes',
'#forge:tomato_sauces'
);
});
// There is a recipe that uses the skillet, but very different ingredients
event.remove({id: 'croptopia:cheeseburger'});
// Allow the apple pie to be automated in create, and use other eggs
event.replaceInput({output: 'croptopia:apple_pie'},
'minecraft:egg',
'#forge:eggs'
);
event.recipes.create.mixing(
'croptopia:apple_pie', [
'minecraft:apple',
'minecraft:sugar',
'#forge:eggs',
'#forge:flour',
'#forge:dough'
]
).heated();
});