From ae095c7f23fdff907e5b1301460a7902b04e89b1 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 19 Jul 2022 00:11:48 +0200 Subject: [PATCH] Merge kettle brewing into single file --- kubejs/server_scripts/_global.js | 20 ------- .../recipes/adorn_uses_kettle.js | 10 ---- kubejs/server_scripts/recipes/brewing.js | 29 ---------- .../server_scripts/recipes/kettle_brewing.js | 56 +++++++++++++++++++ 4 files changed, 56 insertions(+), 59 deletions(-) delete mode 100644 kubejs/server_scripts/_global.js delete mode 100644 kubejs/server_scripts/recipes/adorn_uses_kettle.js delete mode 100644 kubejs/server_scripts/recipes/brewing.js create mode 100644 kubejs/server_scripts/recipes/kettle_brewing.js diff --git a/kubejs/server_scripts/_global.js b/kubejs/server_scripts/_global.js deleted file mode 100644 index a378379..0000000 --- a/kubejs/server_scripts/_global.js +++ /dev/null @@ -1,20 +0,0 @@ -// priority: 100 - -// 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 deleted file mode 100644 index 7372be9..0000000 --- a/kubejs/server_scripts/recipes/adorn_uses_kettle.js +++ /dev/null @@ -1,10 +0,0 @@ -// 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 deleted file mode 100644 index aa843ec..0000000 --- a/kubejs/server_scripts/recipes/brewing.js +++ /dev/null @@ -1,29 +0,0 @@ -// 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" }); -}); diff --git a/kubejs/server_scripts/recipes/kettle_brewing.js b/kubejs/server_scripts/recipes/kettle_brewing.js new file mode 100644 index 0000000..49e2197 --- /dev/null +++ b/kubejs/server_scripts/recipes/kettle_brewing.js @@ -0,0 +1,56 @@ +// priority: 0 + +onEvent("recipes", event => { + function brewing(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)); + } + + // Twilight Delight + 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("twilightdelight:thorn_rose_tea" , [ "twilightforest:thorn_rose" , "minecraft:sugar" ]); + brewing("twilightdelight:torchberry_juice" , [ "twilightforest:torchberries" , "minecraft:sugar" ]); + brewing("twilightdelight:twilight_spring" , [ "twilightforest:raw_ironwood" , "minecraft:ice" ], { needwater: false }); + brewing("twilightdelight:phytochemical_juice", [ "twilightforest:steeleaf_ingot", "twilightforest:liveroot" ]); + brewing("twilightdelight:tear_drink" , [ "twilightforest:fiery_tears" , "minecraft:ghast_tear" ]); + brewing("twilightdelight:glacier_ice_tea" , [ "twilightforest:ice_bomb" , "minecraft:ice" ], { needwater: false }); + + // Corn Delight + event.remove({ output: "corn_delight:creamy_corn_drink" }); + brewing("corn_delight:creamy_corn_drink", [ "corn_delight:corn", "minecraft:sugar" ], + { container: "farmersdelight:milk_bottle", brewingtime: 100, needwater: false }); + + // Create / Create Confectionery + event.remove({ id: "twilightdelight:cooking/builders_tea" }); + brewing("create:builders_tea", [ "#farmersrespite:tea_leaves", "#forge:milk" ]); + brewing("create_confectionery:hot_chocolate_bottle", [ "create_confectionery:cocoa_powder", "minecraft:sugar" ], + { container: "farmersdelight:milk_bottle", brewingtime: 100, needwater: false }); + + // Farmer's Delight + event.remove({ id: "farmersdelight:cooking/hot_cocoa" }); + event.remove({ id: "farmersdelight:cooking/apple_cider" }); + // Farmer's Respite already adds brewing recipes for these. + + // Adorn + event.remove({ output: "adorn:brewer" }); + brewing("adorn:hot_chocolate" , [ "minecraft:cocoa_beans" , "#forge:milk" ], { container: "adorn:mug", brewingtime: 100, needwater: false }); + brewing("adorn:sweet_berry_juice" , [ "minecraft:sweet_berries", "minecraft:sugar" ], { container: "adorn:mug" }); + brewing("adorn:glow_berry_tea" , [ "minecraft:glow_berries" , "#farmersrespite:tea_leaves" ], { container: "adorn:mug" }); + brewing("adorn:nether_wart_coffee", [ "minecraft:nether_wart" , "#forge:milk" ], { container: "adorn:mug", needwater: false }); +});