From f03f4cca6d5217fd909bcbba40f78da8aa47c1b0 Mon Sep 17 00:00:00 2001 From: copygirl Date: Mon, 18 Jul 2022 12:08:07 +0200 Subject: [PATCH] Brewing mod inter-compatibility --- kubejs/server_scripts/_global.js | 20 +++++++++++++ .../recipes/adorn_uses_kettle.js | 10 +++++++ kubejs/server_scripts/recipes/brewing.js | 29 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 kubejs/server_scripts/recipes/adorn_uses_kettle.js create mode 100644 kubejs/server_scripts/recipes/brewing.js diff --git a/kubejs/server_scripts/_global.js b/kubejs/server_scripts/_global.js index 75e6d48..ae4f7cb 100644 --- a/kubejs/server_scripts/_global.js +++ b/kubejs/server_scripts/_global.js @@ -1,5 +1,6 @@ // priority: 100 +// Add sawmill recipe (from Corail Woodcutter) function sawmill(event, output, input) { let i = Ingredient.of(input); let o = Item.of(output); @@ -8,3 +9,22 @@ function sawmill(event, output, input) { ingredient: i.toJson(), result: o.getId(), count: o.getCount() }); } + +// Add brewing recipe (from Farmer's Respite) +// "brewingtime" tends to be 100 for simple recipes, 2400 for things that need to be brewed +// "needwater" can be set to false if liquid is already supplied +function brewing(event, output, inputs, options) { + let i = inputs.map(input => Ingredient.of(input).toJson()); + let o = Item.of(output).toJson(); + if (options && options.container) + options.container = Ingredient.of(options.container).toJson(); + event.custom(Object.assign({ + type: "farmersrespite:brewing", + ingredients: i, + result: o, + container: { item: "minecraft:glass_bottle" }, + experience: 0.35, + brewingtime: 2400, + needwater: true, + }, options)); +} diff --git a/kubejs/server_scripts/recipes/adorn_uses_kettle.js b/kubejs/server_scripts/recipes/adorn_uses_kettle.js new file mode 100644 index 0000000..7372be9 --- /dev/null +++ b/kubejs/server_scripts/recipes/adorn_uses_kettle.js @@ -0,0 +1,10 @@ +// priority: 0 + +onEvent("recipes", event => { + event.remove({ output: "adorn:brewer" }); + + brewing(event, "adorn:hot_chocolate" , [ "minecraft:cocoa_beans" , "#forge:milk" ], { container: "adorn:mug", brewingtime: 100, needwater: false }); + brewing(event, "adorn:sweet_berry_juice" , [ "minecraft:sweet_berries", "minecraft:sugar" ], { container: "adorn:mug" }); + brewing(event, "adorn:glow_berry_tea" , [ "minecraft:glow_berries" , "#farmersrespite:tea_leaves" ], { container: "adorn:mug" }); + brewing(event, "adorn:nether_wart_coffee", [ "minecraft:nether_wart" , "#forge:milk" ], { container: "adorn:mug", needwater: false }); +}); diff --git a/kubejs/server_scripts/recipes/brewing.js b/kubejs/server_scripts/recipes/brewing.js new file mode 100644 index 0000000..aa843ec --- /dev/null +++ b/kubejs/server_scripts/recipes/brewing.js @@ -0,0 +1,29 @@ +// priority: 0 + +onEvent("recipes", event => { + event.remove({ output: "twilightdelight:thorn_rose_tea" }); + event.remove({ output: "twilightdelight:torchberry_juice" }); + event.remove({ output: "twilightdelight:twilight_spring" }); + event.remove({ output: "twilightdelight:phytochemical_juice" }); + event.remove({ output: "twilightdelight:tear_drink" }); + event.remove({ output: "twilightdelight:glacier_ice_tea" }); + brewing(event, "twilightdelight:thorn_rose_tea" , [ "twilightforest:thorn_rose" , "minecraft:sugar" ]); + brewing(event, "twilightdelight:torchberry_juice" , [ "twilightforest:torchberries" , "minecraft:sugar" ]); + brewing(event, "twilightdelight:twilight_spring" , [ "twilightforest:raw_ironwood" , "minecraft:ice" ], { needwater: false }); + brewing(event, "twilightdelight:phytochemical_juice", [ "twilightforest:steeleaf_ingot", "twilightforest:liveroot" ]); + brewing(event, "twilightdelight:tear_drink" , [ "twilightforest:fiery_tears" , "minecraft:ghast_tear" ]); + brewing(event, "twilightdelight:glacier_ice_tea" , [ "twilightforest:ice_bomb" , "minecraft:ice" ], { needwater: false }); + + event.remove({ output: "corn_delight:creamy_corn_drink" }); + brewing(event, "corn_delight:creamy_corn_drink", [ "corn_delight:corn", "minecraft:sugar" ], + { container: "farmersdelight:milk_bottle", brewingtime: 100, needwater: false }); + + event.remove({ id: "twilightdelight:cooking/builders_tea" }); + brewing(event, "create:builders_tea", [ "#farmersrespite:tea_leaves", "#forge:milk" ]); + brewing(event, "create_confectionery:hot_chocolate_bottle", [ "create_confectionery:cocoa_powder", "minecraft:sugar" ], + { container: "farmersdelight:milk_bottle", brewingtime: 100, needwater: false }); + + // Added by Farmer's Respite + event.remove({ id: "farmersdelight:cooking/hot_cocoa" }); + event.remove({ id: "farmersdelight:cooking/apple_cider" }); +});