From a00be112ac7d225ee16c24d16c5e85fcb4dbf8be Mon Sep 17 00:00:00 2001 From: Ninjdai Date: Sun, 29 Dec 2024 16:36:31 +0100 Subject: [PATCH] feat: dehydration and tough as nails compat --- .gitignore | 2 + .../hydration_items/beachparty_items.json | 36 ++++ .../hydration_items/brewery_items.json | 28 +++ .../hydration_items/candlelight_items.json | 19 ++ .../hydration_items/cornexpansion_items.json | 8 + .../hydration_items/farm_and_charm_items.json | 29 +++ .../hydration_items/herbalbrews_items.json | 27 +++ .../hydration_items/meadow_items.json | 14 ++ .../items/hydration/10_hydration_drinks.json | 97 ++++++++++ .../items/hydration/20_hydration_drinks.json | 169 ++++++++++++++++ .../items/hydration/30_hydration_drinks.json | 53 +++++ .../items/hydration/50_hydration_drinks.json | 9 + utils/thirst.py | 181 ++++++++++++++++++ 13 files changed, 672 insertions(+) create mode 100644 common/src/main/resources/data/dehydration/hydration_items/beachparty_items.json create mode 100644 common/src/main/resources/data/dehydration/hydration_items/brewery_items.json create mode 100644 common/src/main/resources/data/dehydration/hydration_items/candlelight_items.json create mode 100644 common/src/main/resources/data/dehydration/hydration_items/cornexpansion_items.json create mode 100644 common/src/main/resources/data/dehydration/hydration_items/farm_and_charm_items.json create mode 100644 common/src/main/resources/data/dehydration/hydration_items/herbalbrews_items.json create mode 100644 common/src/main/resources/data/dehydration/hydration_items/meadow_items.json create mode 100644 common/src/main/resources/data/toughasnails/tags/items/hydration/10_hydration_drinks.json create mode 100644 common/src/main/resources/data/toughasnails/tags/items/hydration/20_hydration_drinks.json create mode 100644 common/src/main/resources/data/toughasnails/tags/items/hydration/30_hydration_drinks.json create mode 100644 common/src/main/resources/data/toughasnails/tags/items/hydration/50_hydration_drinks.json create mode 100644 utils/thirst.py diff --git a/.gitignore b/.gitignore index d5f737e..d404185 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +utils/output/ + # User-specific stuff .idea/ diff --git a/common/src/main/resources/data/dehydration/hydration_items/beachparty_items.json b/common/src/main/resources/data/dehydration/hydration_items/beachparty_items.json new file mode 100644 index 0000000..1cb14b8 --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/beachparty_items.json @@ -0,0 +1,36 @@ +{ + "1": { + "replace": false, + "items": [ + "beachparty:coconut_open", + "beachparty:honey_cocktail", + "beachparty:sweetberry_milkshake", + "beachparty:coconut_milkshake", + "beachparty:chocolate_milkshake", + "beachparty:sweetberry_icecream", + "beachparty:coconut_icecream", + "beachparty:chocolate_icecream", + "beachparty:icecream_coconut", + "beachparty:icecream_cactus", + "beachparty:icecream_chocolate", + "beachparty:icecream_sweetberries", + "beachparty:icecream_melon" + ] + }, + "2": { + "replace": false, + "items": [ + "beachparty:coconut_cocktail", + "beachparty:sweetberries_cocktail", + "beachparty:cocoa_cocktail", + "beachparty:pumpkin_cocktail", + "beachparty:melon_cocktail" + ] + }, + "5": { + "replace": false, + "items": [ + "beachparty:refreshing_drink" + ] + } +} diff --git a/common/src/main/resources/data/dehydration/hydration_items/brewery_items.json b/common/src/main/resources/data/dehydration/hydration_items/brewery_items.json new file mode 100644 index 0000000..85cacb1 --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/brewery_items.json @@ -0,0 +1,28 @@ +{ + "2": { + "replace": false, + "items": [ + "brewery:whiskey", + "brewery:whiskey_jojannik", + "brewery:whiskey_lilitusinglemalt", + "brewery:whiskey_cristelwalker", + "brewery:whiskey_maggoallan", + "brewery:whiskey_carrasconlabel", + "brewery:whiskey_ak", + "brewery:whiskey_highland_hearth", + "brewery:whiskey_smokey_reverie", + "brewery:whiskey_jamesons_malt" + ] + }, + "3": { + "replace": false, + "items": [ + "brewery:beer_wheat", + "brewery:beer_barley", + "brewery:beer_hops", + "brewery:beer_nettle", + "brewery:beer_oat", + "brewery:beer_haley" + ] + } +} diff --git a/common/src/main/resources/data/dehydration/hydration_items/candlelight_items.json b/common/src/main/resources/data/dehydration/hydration_items/candlelight_items.json new file mode 100644 index 0000000..a7a7c9d --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/candlelight_items.json @@ -0,0 +1,19 @@ +{ + "1": { + "replace": false, + "items": [ + "candlelight:beetroot_salad", + "candlelight:salad", + "candlelight:mozzarella", + "candlelight:fresh_garden_salad", + "candlelight:tomato_mozzarella_salad" + ] + }, + "3": { + "replace": false, + "items": [ + "candlelight:tomato_soup", + "candlelight:mushroom_soup" + ] + } +} diff --git a/common/src/main/resources/data/dehydration/hydration_items/cornexpansion_items.json b/common/src/main/resources/data/dehydration/hydration_items/cornexpansion_items.json new file mode 100644 index 0000000..d532206 --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/cornexpansion_items.json @@ -0,0 +1,8 @@ +{ + "1": { + "replace": false, + "items": [ + "cornexpansion:corn_syrup" + ] + } +} diff --git a/common/src/main/resources/data/dehydration/hydration_items/farm_and_charm_items.json b/common/src/main/resources/data/dehydration/hydration_items/farm_and_charm_items.json new file mode 100644 index 0000000..a251ffa --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/farm_and_charm_items.json @@ -0,0 +1,29 @@ +{ + "1": { + "replace": false, + "items": [ + "farm_and_charm:tomato", + "farm_and_charm:farmer_salad" + ] + }, + "2": { + "replace": false, + "items": [ + "farm_and_charm:strawberry_tea", + "farm_and_charm:nettle_tea", + "farm_and_charm:ribwort_tea", + "farm_and_charm:strawberry_tea_cup", + "farm_and_charm:nettle_tea_cup", + "farm_and_charm:ribwort_tea_cup" + ] + }, + "3": { + "replace": false, + "items": [ + "farm_and_charm:simple_tomato_soup", + "farm_and_charm:barley_soup", + "farm_and_charm:onion_soup", + "farm_and_charm:potato_soup" + ] + } +} diff --git a/common/src/main/resources/data/dehydration/hydration_items/herbalbrews_items.json b/common/src/main/resources/data/dehydration/hydration_items/herbalbrews_items.json new file mode 100644 index 0000000..369c755 --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/herbalbrews_items.json @@ -0,0 +1,27 @@ +{ + "1": { + "replace": false, + "items": [ + "herbalbrews:coffee", + "herbalbrews:milk_coffee" + ] + }, + "2": { + "replace": false, + "items": [ + "herbalbrews:green_tea", + "herbalbrews:black_tea", + "herbalbrews:hibiscus_tea", + "herbalbrews:lavender_tea", + "herbalbrews:yerba_mate_tea", + "herbalbrews:rooibos_tea", + "herbalbrews:oolong_tea", + "herbalbrews:armor_flask", + "herbalbrews:armor_flask_big", + "herbalbrews:damage_flask", + "herbalbrews:damage_flask_big", + "herbalbrews:feral_flask", + "herbalbrews:feral_flask_big" + ] + } +} diff --git a/common/src/main/resources/data/dehydration/hydration_items/meadow_items.json b/common/src/main/resources/data/dehydration/hydration_items/meadow_items.json new file mode 100644 index 0000000..fb91d95 --- /dev/null +++ b/common/src/main/resources/data/dehydration/hydration_items/meadow_items.json @@ -0,0 +1,14 @@ +{ + "2": { + "replace": false, + "items": [ + "meadow:wooden_milk_bucket", + "meadow:wooden_sheep_milk_bucket", + "meadow:wooden_buffalo_milk_bucket", + "meadow:wooden_goat_milk_bucket", + "meadow:wooden_warped_milk_bucket", + "meadow:wooden_grain_milk_bucket", + "meadow:wooden_amethyst_milk_bucket" + ] + } +} diff --git a/common/src/main/resources/data/toughasnails/tags/items/hydration/10_hydration_drinks.json b/common/src/main/resources/data/toughasnails/tags/items/hydration/10_hydration_drinks.json new file mode 100644 index 0000000..7b1004c --- /dev/null +++ b/common/src/main/resources/data/toughasnails/tags/items/hydration/10_hydration_drinks.json @@ -0,0 +1,97 @@ +{ + "replace": false, + "values": [ + { + "required": false, + "id": "beachparty:coconut_open" + }, + { + "required": false, + "id": "beachparty:honey_cocktail" + }, + { + "required": false, + "id": "beachparty:sweetberry_milkshake" + }, + { + "required": false, + "id": "beachparty:coconut_milkshake" + }, + { + "required": false, + "id": "beachparty:chocolate_milkshake" + }, + { + "required": false, + "id": "beachparty:sweetberry_icecream" + }, + { + "required": false, + "id": "beachparty:coconut_icecream" + }, + { + "required": false, + "id": "beachparty:chocolate_icecream" + }, + { + "required": false, + "id": "beachparty:icecream_coconut" + }, + { + "required": false, + "id": "beachparty:icecream_cactus" + }, + { + "required": false, + "id": "beachparty:icecream_chocolate" + }, + { + "required": false, + "id": "beachparty:icecream_sweetberries" + }, + { + "required": false, + "id": "beachparty:icecream_melon" + }, + { + "required": false, + "id": "candlelight:beetroot_salad" + }, + { + "required": false, + "id": "candlelight:salad" + }, + { + "required": false, + "id": "candlelight:mozzarella" + }, + { + "required": false, + "id": "candlelight:fresh_garden_salad" + }, + { + "required": false, + "id": "candlelight:tomato_mozzarella_salad" + }, + { + "required": false, + "id": "cornexpansion:corn_syrup" + }, + { + "required": false, + "id": "farm_and_charm:tomato" + }, + { + "required": false, + "id": "farm_and_charm:farmer_salad" + }, + { + "required": false, + "id": "herbalbrews:coffee" + }, + { + "required": false, + "id": "herbalbrews:milk_coffee" + } + ] +} diff --git a/common/src/main/resources/data/toughasnails/tags/items/hydration/20_hydration_drinks.json b/common/src/main/resources/data/toughasnails/tags/items/hydration/20_hydration_drinks.json new file mode 100644 index 0000000..e6b27f6 --- /dev/null +++ b/common/src/main/resources/data/toughasnails/tags/items/hydration/20_hydration_drinks.json @@ -0,0 +1,169 @@ +{ + "replace": false, + "values": [ + { + "required": false, + "id": "beachparty:coconut_cocktail" + }, + { + "required": false, + "id": "beachparty:sweetberries_cocktail" + }, + { + "required": false, + "id": "beachparty:cocoa_cocktail" + }, + { + "required": false, + "id": "beachparty:pumpkin_cocktail" + }, + { + "required": false, + "id": "beachparty:melon_cocktail" + }, + { + "required": false, + "id": "brewery:whiskey" + }, + { + "required": false, + "id": "brewery:whiskey_jojannik" + }, + { + "required": false, + "id": "brewery:whiskey_lilitusinglemalt" + }, + { + "required": false, + "id": "brewery:whiskey_cristelwalker" + }, + { + "required": false, + "id": "brewery:whiskey_maggoallan" + }, + { + "required": false, + "id": "brewery:whiskey_carrasconlabel" + }, + { + "required": false, + "id": "brewery:whiskey_ak" + }, + { + "required": false, + "id": "brewery:whiskey_highland_hearth" + }, + { + "required": false, + "id": "brewery:whiskey_smokey_reverie" + }, + { + "required": false, + "id": "brewery:whiskey_jamesons_malt" + }, + { + "required": false, + "id": "farm_and_charm:strawberry_tea" + }, + { + "required": false, + "id": "farm_and_charm:nettle_tea" + }, + { + "required": false, + "id": "farm_and_charm:ribwort_tea" + }, + { + "required": false, + "id": "farm_and_charm:strawberry_tea_cup" + }, + { + "required": false, + "id": "farm_and_charm:nettle_tea_cup" + }, + { + "required": false, + "id": "farm_and_charm:ribwort_tea_cup" + }, + { + "required": false, + "id": "herbalbrews:green_tea" + }, + { + "required": false, + "id": "herbalbrews:black_tea" + }, + { + "required": false, + "id": "herbalbrews:hibiscus_tea" + }, + { + "required": false, + "id": "herbalbrews:lavender_tea" + }, + { + "required": false, + "id": "herbalbrews:yerba_mate_tea" + }, + { + "required": false, + "id": "herbalbrews:rooibos_tea" + }, + { + "required": false, + "id": "herbalbrews:oolong_tea" + }, + { + "required": false, + "id": "herbalbrews:armor_flask" + }, + { + "required": false, + "id": "herbalbrews:armor_flask_big" + }, + { + "required": false, + "id": "herbalbrews:damage_flask" + }, + { + "required": false, + "id": "herbalbrews:damage_flask_big" + }, + { + "required": false, + "id": "herbalbrews:feral_flask" + }, + { + "required": false, + "id": "herbalbrews:feral_flask_big" + }, + { + "required": false, + "id": "meadow:wooden_milk_bucket" + }, + { + "required": false, + "id": "meadow:wooden_sheep_milk_bucket" + }, + { + "required": false, + "id": "meadow:wooden_buffalo_milk_bucket" + }, + { + "required": false, + "id": "meadow:wooden_goat_milk_bucket" + }, + { + "required": false, + "id": "meadow:wooden_warped_milk_bucket" + }, + { + "required": false, + "id": "meadow:wooden_grain_milk_bucket" + }, + { + "required": false, + "id": "meadow:wooden_amethyst_milk_bucket" + } + ] +} diff --git a/common/src/main/resources/data/toughasnails/tags/items/hydration/30_hydration_drinks.json b/common/src/main/resources/data/toughasnails/tags/items/hydration/30_hydration_drinks.json new file mode 100644 index 0000000..43cb1c7 --- /dev/null +++ b/common/src/main/resources/data/toughasnails/tags/items/hydration/30_hydration_drinks.json @@ -0,0 +1,53 @@ +{ + "replace": false, + "values": [ + { + "required": false, + "id": "brewery:beer_wheat" + }, + { + "required": false, + "id": "brewery:beer_barley" + }, + { + "required": false, + "id": "brewery:beer_hops" + }, + { + "required": false, + "id": "brewery:beer_nettle" + }, + { + "required": false, + "id": "brewery:beer_oat" + }, + { + "required": false, + "id": "brewery:beer_haley" + }, + { + "required": false, + "id": "candlelight:tomato_soup" + }, + { + "required": false, + "id": "candlelight:mushroom_soup" + }, + { + "required": false, + "id": "farm_and_charm:simple_tomato_soup" + }, + { + "required": false, + "id": "farm_and_charm:barley_soup" + }, + { + "required": false, + "id": "farm_and_charm:onion_soup" + }, + { + "required": false, + "id": "farm_and_charm:potato_soup" + } + ] +} diff --git a/common/src/main/resources/data/toughasnails/tags/items/hydration/50_hydration_drinks.json b/common/src/main/resources/data/toughasnails/tags/items/hydration/50_hydration_drinks.json new file mode 100644 index 0000000..42defe8 --- /dev/null +++ b/common/src/main/resources/data/toughasnails/tags/items/hydration/50_hydration_drinks.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + { + "required": false, + "id": "beachparty:refreshing_drink" + } + ] +} diff --git a/utils/thirst.py b/utils/thirst.py new file mode 100644 index 0000000..132d322 --- /dev/null +++ b/utils/thirst.py @@ -0,0 +1,181 @@ +import json +import os + +HYDRATION_ITEMS = { + "beachparty": { + 1: [ + "coconut_open", + "honey_cocktail", + "sweetberry_milkshake", + "coconut_milkshake", + "chocolate_milkshake", + "sweetberry_icecream", + "coconut_icecream", + "chocolate_icecream", + "icecream_coconut", + "icecream_cactus", + "icecream_chocolate", + "icecream_sweetberries", + "icecream_melon" + ], + 2: [ + "coconut_cocktail", + "sweetberries_cocktail", + "cocoa_cocktail", + "pumpkin_cocktail", + "melon_cocktail" + ], + 5: [ + "refreshing_drink" + ] + }, + "brewery": { + 2: [ + "whiskey", + "whiskey_jojannik", + "whiskey_lilitusinglemalt", + "whiskey_cristelwalker", + "whiskey_maggoallan", + "whiskey_carrasconlabel", + "whiskey_ak", + "whiskey_highland_hearth", + "whiskey_smokey_reverie", + "whiskey_jamesons_malt" + ], + 3: [ + "beer_wheat", + "beer_barley", + "beer_hops", + "beer_nettle", + "beer_oat", + "beer_haley" + ] + }, + "candlelight": { + 1: [ + "beetroot_salad", + "salad", + "mozzarella", + "fresh_garden_salad", + "tomato_mozzarella_salad" + ], + 3: [ + "tomato_soup", + "mushroom_soup" + ] + }, + "cornexpansion": { + 1: [ + "corn_syrup" + ] + }, + "farm_and_charm": { + 1: [ + "tomato", + "farmer_salad" + ], + 2: [ + "strawberry_tea", + "nettle_tea", + "ribwort_tea", + "strawberry_tea_cup", + "nettle_tea_cup", + "ribwort_tea_cup" + ], + 3: [ + "simple_tomato_soup", + "barley_soup", + "onion_soup", + "potato_soup" + ] + }, + "herbalbrews": { + 1: [ + "coffee", + "milk_coffee" + ], + 2: [ + "green_tea", + "black_tea", + "hibiscus_tea", + "lavender_tea", + "yerba_mate_tea", + "rooibos_tea", + "oolong_tea", + "armor_flask", + "armor_flask_big", + "damage_flask", + "damage_flask_big", + "feral_flask", + "feral_flask_big" + ] + }, + "meadow": { + 2: [ + "wooden_milk_bucket", + "wooden_sheep_milk_bucket", + "wooden_buffalo_milk_bucket", + "wooden_goat_milk_bucket", + "wooden_warped_milk_bucket", + "wooden_grain_milk_bucket", + "wooden_amethyst_milk_bucket" + ] + } +} +for mod in HYDRATION_ITEMS: + for hydration_value in HYDRATION_ITEMS[mod]: + for i in range(len(HYDRATION_ITEMS[mod][hydration_value])): + HYDRATION_ITEMS[mod][hydration_value][i] = f"{mod}:{HYDRATION_ITEMS[mod][hydration_value][i]}" + +class ThirstFile: + name: str + content: str + +def generateThirstData() -> list[ThirstFile]: + files: list[ThirstFile] = [] + # Tough As Nails + hydration_concat: dict[int, list[str]] = {} + for mod in HYDRATION_ITEMS: + for hydration_value in HYDRATION_ITEMS[mod]: + if hydration_value not in hydration_concat: + hydration_concat[hydration_value] = [] + hydration_concat[hydration_value].extend(HYDRATION_ITEMS[mod][hydration_value]) + for hydration_value in hydration_concat: + f = ThirstFile() + f.name = f"data/toughasnails/tags/items/hydration/{hydration_value}0_hydration_drinks.json" + items = [] + for item in hydration_concat[hydration_value]: + items.append({ + "required": False, + "id": item + }) + f.content = json.dumps({ + "replace": False, + "values": items + }, indent=4) + files.append(f) + + # Dehydration + for mod in HYDRATION_ITEMS: + f = ThirstFile() + f.name = f"data/dehydration/hydration_items/{mod}_items.json" + content = {} + for hydration_value in HYDRATION_ITEMS[mod]: + content[str(hydration_value)] = { + "replace": False, + "items": HYDRATION_ITEMS[mod][hydration_value] + } + f.content = json.dumps(content, indent=4) + files.append(f) + return files + +OUTPUT_PATH: str = "./utils/output/" + +file_list: list[ThirstFile] = generateThirstData() +for file in file_list: + file_dir = file.name.split("/") + file_dir.pop() + file_dir = OUTPUT_PATH+'/'.join(file_dir) + os.makedirs(file_dir, exist_ok=True) + with open(f"{OUTPUT_PATH}{file.name}", "w") as f: + print(file.content, file=f)