From 357b875b3c961d793e232d79a50d6eb8ecde90a4 Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:26:14 -0400 Subject: [PATCH 1/7] Market Cleanup --- config/farmingforblockheads-common.toml | 4 +-- .../market_presets/market_trades.json | 4 +++ .../market_presets/market_trades.json | 4 +++ .../farmingforblockheads_preset_whitelist.js | 10 ++++++ .../recipes/farmingforblockheads/market.js | 31 +++++++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 kubejs/data/enigmatica/market_presets/market_trades.json create mode 100644 kubejs/data/occultism/market_presets/market_trades.json create mode 100644 kubejs/server_scripts/constants/farmingforblockheads_preset_whitelist.js create mode 100644 kubejs/server_scripts/recipes/farmingforblockheads/market.js diff --git a/config/farmingforblockheads-common.toml b/config/farmingforblockheads-common.toml index 37879a0a..2ecd0f26 100644 --- a/config/farmingforblockheads-common.toml +++ b/config/farmingforblockheads-common.toml @@ -1,9 +1,9 @@ #List of default presets to disable. disabledDefaultPresets = [] #List of optional presets to enable. -enabledOptionalPresets = ["minecraft:flowers", "minecraft:mushrooms"] +enabledOptionalPresets = [] #List of names the merchant can have. -merchantNames = ["Swap-O-Matic", "Emerald Muncher", "Weathered Salesperson"] +merchantNames = ["Swap-O-Matic", "Emerald Muncher", "Gold-Digger", "Weathered Salesperson"] #The range within animals can be fed by the feeding trough. #Range: > -2147483648 feedingTroughRange = 8 diff --git a/kubejs/data/enigmatica/market_presets/market_trades.json b/kubejs/data/enigmatica/market_presets/market_trades.json new file mode 100644 index 00000000..688a169e --- /dev/null +++ b/kubejs/data/enigmatica/market_presets/market_trades.json @@ -0,0 +1,4 @@ +{ + "enabled": true, + "payment": { "ingredient": { "item": "minecraft:gold_nugget" }, "count": 3 } +} diff --git a/kubejs/data/occultism/market_presets/market_trades.json b/kubejs/data/occultism/market_presets/market_trades.json new file mode 100644 index 00000000..a87496ae --- /dev/null +++ b/kubejs/data/occultism/market_presets/market_trades.json @@ -0,0 +1,4 @@ +{ + "enabled": true, + "payment": { "ingredient": { "item": "occultism:spirit_attuned_gem" }, "count": 1 } +} diff --git a/kubejs/server_scripts/constants/farmingforblockheads_preset_whitelist.js b/kubejs/server_scripts/constants/farmingforblockheads_preset_whitelist.js new file mode 100644 index 00000000..404613a9 --- /dev/null +++ b/kubejs/server_scripts/constants/farmingforblockheads_preset_whitelist.js @@ -0,0 +1,10 @@ +//priority: 1001 + +const farmingforblockheads_preset_whitelist = [ + 'minecraft:mushrooms', + 'minecraft:saplings', + 'minecraft:flowers', + 'minecraft:seed_crops', + 'minecraft:crops', + 'minecraft:seeds' +]; diff --git a/kubejs/server_scripts/recipes/farmingforblockheads/market.js b/kubejs/server_scripts/recipes/farmingforblockheads/market.js new file mode 100644 index 00000000..82c40323 --- /dev/null +++ b/kubejs/server_scripts/recipes/farmingforblockheads/market.js @@ -0,0 +1,31 @@ +ServerEvents.recipes((event) => { + const id_prefix = 'enigmatica:farmingforblockheads/market/'; + const recipes = [ + { + category: 'farmingforblockheads:saplings', + preset: 'occultism:market_trades', + result: { count: 1, item: 'occultism:otherworld_sapling' }, + id: `${id_prefix}otherworld_sapling` + } + ]; + + event.forEachRecipe({ type: 'farmingforblockheads:market' }, (r) => { + let recipe = JSON.parse(r.json); + let recipe_id = r.getId(); + + if (!farmingforblockheads_preset_whitelist.includes(recipe.preset)) { + event.remove({ id: recipe_id }); + } else { + recipe.preset = 'enigmatica:market_trades'; + recipe.id = `${id_prefix}${recipe_id.split('market/').pop()}`; + event.remove({ id: recipe_id }); + recipes.push(recipe); + } + }); + + recipes.forEach((recipe) => { + recipe.type = 'farmingforblockheads:market'; + if (!recipe.preset) recipe.preset = 'enigmatica:market_trades'; + event.custom(recipe).id(recipe.id); + }); +}); From 91915d20ebd7b98b7c931e85fca1eccf463ee559 Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:35:03 -0400 Subject: [PATCH 2/7] Update market.js --- .../recipes/farmingforblockheads/market.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kubejs/server_scripts/recipes/farmingforblockheads/market.js b/kubejs/server_scripts/recipes/farmingforblockheads/market.js index 82c40323..5654dd85 100644 --- a/kubejs/server_scripts/recipes/farmingforblockheads/market.js +++ b/kubejs/server_scripts/recipes/farmingforblockheads/market.js @@ -6,6 +6,21 @@ ServerEvents.recipes((event) => { preset: 'occultism:market_trades', result: { count: 1, item: 'occultism:otherworld_sapling' }, id: `${id_prefix}otherworld_sapling` + }, + { + category: 'farmingforblockheads:seeds', + result: { count: 1, item: 'occultism:datura_seeds' }, + id: `${id_prefix}datura_seeds` + }, + { + category: 'farmingforblockheads:saplings', + result: { count: 1, item: 'arts_and_crafts:cork_sapling' }, + id: `${id_prefix}cork_sapling` + }, + { + category: 'farmingforblockheads:saplings', + result: { count: 1, item: 'minecraft:mangrove_propagule' }, + id: `${id_prefix}mangrove_propagule` } ]; From 9ff78677b452b00ad6843b48ff0e6d06c59b06c1 Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:41:15 -0400 Subject: [PATCH 3/7] fertilizers --- .../recipes/farmingforblockheads/market.js | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/kubejs/server_scripts/recipes/farmingforblockheads/market.js b/kubejs/server_scripts/recipes/farmingforblockheads/market.js index 5654dd85..652bae40 100644 --- a/kubejs/server_scripts/recipes/farmingforblockheads/market.js +++ b/kubejs/server_scripts/recipes/farmingforblockheads/market.js @@ -21,6 +21,26 @@ ServerEvents.recipes((event) => { category: 'farmingforblockheads:saplings', result: { count: 1, item: 'minecraft:mangrove_propagule' }, id: `${id_prefix}mangrove_propagule` + }, + { + category: 'farmingforblockheads:saplings', + result: { count: 4, item: 'farmingforblockheads:green_fertilizer' }, + id: `${id_prefix}green_fertilizer` + }, + { + category: 'farmingforblockheads:saplings', + result: { count: 4, item: 'farmingforblockheads:red_fertilizer' }, + id: `${id_prefix}red_fertilizer` + }, + { + category: 'farmingforblockheads:saplings', + result: { count: 4, item: 'farmingforblockheads:yellow_fertilizer' }, + id: `${id_prefix}yellow_fertilizer` + }, + { + category: 'farmingforblockheads:saplings', + result: { count: 12, item: 'minecraft:bone_meal' }, + id: `${id_prefix}bone_meal` } ]; @@ -28,14 +48,12 @@ ServerEvents.recipes((event) => { let recipe = JSON.parse(r.json); let recipe_id = r.getId(); - if (!farmingforblockheads_preset_whitelist.includes(recipe.preset)) { - event.remove({ id: recipe_id }); - } else { + if (farmingforblockheads_preset_whitelist.includes(recipe.preset)) { recipe.preset = 'enigmatica:market_trades'; recipe.id = `${id_prefix}${recipe_id.split('market/').pop()}`; - event.remove({ id: recipe_id }); recipes.push(recipe); } + event.remove({ id: recipe_id }); }); recipes.forEach((recipe) => { From 40afea0ae714c8b60b8c6db8f1292b962c4d357a Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:42:34 -0400 Subject: [PATCH 4/7] categories --- .../server_scripts/recipes/farmingforblockheads/market.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kubejs/server_scripts/recipes/farmingforblockheads/market.js b/kubejs/server_scripts/recipes/farmingforblockheads/market.js index 652bae40..19c005a3 100644 --- a/kubejs/server_scripts/recipes/farmingforblockheads/market.js +++ b/kubejs/server_scripts/recipes/farmingforblockheads/market.js @@ -23,22 +23,22 @@ ServerEvents.recipes((event) => { id: `${id_prefix}mangrove_propagule` }, { - category: 'farmingforblockheads:saplings', + category: 'farmingforblockheads:other', result: { count: 4, item: 'farmingforblockheads:green_fertilizer' }, id: `${id_prefix}green_fertilizer` }, { - category: 'farmingforblockheads:saplings', + category: 'farmingforblockheads:other', result: { count: 4, item: 'farmingforblockheads:red_fertilizer' }, id: `${id_prefix}red_fertilizer` }, { - category: 'farmingforblockheads:saplings', + category: 'farmingforblockheads:other', result: { count: 4, item: 'farmingforblockheads:yellow_fertilizer' }, id: `${id_prefix}yellow_fertilizer` }, { - category: 'farmingforblockheads:saplings', + category: 'farmingforblockheads:other', result: { count: 12, item: 'minecraft:bone_meal' }, id: `${id_prefix}bone_meal` } From 70a30fa14bd67c1a0c7b52fcaaac3df7e3421c26 Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:43:58 -0400 Subject: [PATCH 5/7] cocoa --- kubejs/server_scripts/recipes/farmingforblockheads/market.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kubejs/server_scripts/recipes/farmingforblockheads/market.js b/kubejs/server_scripts/recipes/farmingforblockheads/market.js index 19c005a3..ec47518a 100644 --- a/kubejs/server_scripts/recipes/farmingforblockheads/market.js +++ b/kubejs/server_scripts/recipes/farmingforblockheads/market.js @@ -12,6 +12,11 @@ ServerEvents.recipes((event) => { result: { count: 1, item: 'occultism:datura_seeds' }, id: `${id_prefix}datura_seeds` }, + { + category: 'farmingforblockheads:seeds', + result: { count: 1, item: 'minecraft:cocoa_beans' }, + id: `${id_prefix}cocoa_beans` + }, { category: 'farmingforblockheads:saplings', result: { count: 1, item: 'arts_and_crafts:cork_sapling' }, From 8c79b5a66590b7d4fa9127869620bb07b4a450df Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:51:49 -0400 Subject: [PATCH 6/7] Create ritual.js --- .../recipes/occultism/ritual.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 kubejs/server_scripts/recipes/occultism/ritual.js diff --git a/kubejs/server_scripts/recipes/occultism/ritual.js b/kubejs/server_scripts/recipes/occultism/ritual.js new file mode 100644 index 00000000..38042f3d --- /dev/null +++ b/kubejs/server_scripts/recipes/occultism/ritual.js @@ -0,0 +1,19 @@ +ServerEvents.recipes((event) => { + const id_prefix = 'enigmatica:occultism/ritual/'; + const recipes = []; + + event.forEachRecipe({ type: 'occultism:ritual' }, (r) => { + let recipe = JSON.parse(r.json); + let recipe_id = r.getId(); + + // Override default craft time for all recipes + recipe.duration = 20; + recipe.id = recipe_id; + recipes.push(recipe); + }); + + recipes.forEach((recipe) => { + recipe.type = 'occultism:ritual'; + event.custom(recipe).id(recipe.id); + }); +}); From 6ff03df3cb4b9a9ff6efcad677c790bd17affe08 Mon Sep 17 00:00:00 2001 From: MuteTiefling Date: Sat, 29 Jun 2024 23:57:45 -0400 Subject: [PATCH 7/7] moar seeds --- .../recipes/farmingforblockheads/market.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kubejs/server_scripts/recipes/farmingforblockheads/market.js b/kubejs/server_scripts/recipes/farmingforblockheads/market.js index ec47518a..ab1dcfd0 100644 --- a/kubejs/server_scripts/recipes/farmingforblockheads/market.js +++ b/kubejs/server_scripts/recipes/farmingforblockheads/market.js @@ -12,6 +12,16 @@ ServerEvents.recipes((event) => { result: { count: 1, item: 'occultism:datura_seeds' }, id: `${id_prefix}datura_seeds` }, + { + category: 'farmingforblockheads:seeds', + result: { count: 1, item: 'chococraft:gysahl_green_seeds' }, + id: `${id_prefix}gysahl_green_seeds` + }, + { + category: 'farmingforblockheads:seeds', + result: { count: 1, item: 'jags:grass_seed' }, + id: `${id_prefix}grass_seed` + }, { category: 'farmingforblockheads:seeds', result: { count: 1, item: 'minecraft:cocoa_beans' },