From 4f2c3a95d4bf6a4b9f1b6bd8371b93c8873f7d29 Mon Sep 17 00:00:00 2001 From: Jochen Jacobs Date: Wed, 8 Nov 2023 18:15:42 +0100 Subject: [PATCH] update 1.21 and trial chambers --- locales/en.json | 2 ++ scripts/createVanillaZips.py | 19 +++++++++++-------- src/components/dropdown/OpenDropdown.vue | 9 +++++++-- .../data/c/worldgen/structure_icons.json | 3 +++ 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 vanilla_datapack_base/data/minecraft/datapacks/update_1_21/data/c/worldgen/structure_icons.json diff --git a/locales/en.json b/locales/en.json index d22ccb0..2966a36 100644 --- a/locales/en.json +++ b/locales/en.json @@ -36,6 +36,7 @@ "minecraft.structure.minecraft.stronghold": "Stronghold", "minecraft.structure.minecraft.swamp_hut": "Swamp Hut", "minecraft.structure.minecraft.trail_ruins": "Trail Ruins", + "minecraft.structure.minecraft.trial_chambers": "Trial Chambers", "minecraft.structure.minecraft.village_desert": "Desert Village", "minecraft.structure.minecraft.village_plains": "Plains Village", "minecraft.structure.minecraft.village_savanna": "Savanna Village", @@ -61,6 +62,7 @@ "dropdown.add.picker.mod": "Mods (*.jar)", "dropdown.add.folder": "Open Folder", "dropdown.add.built_in.update_1_20": "Update 1.20", + "dropdown.add.built_in.update_1_21": "Update 1.21", "dropdown.add.built_in.title": "Built-in Datapacks", "dropdown.add.recents.title": "Recently used", "dropdown.add.recents.not_found": "Pack not Found. Removing from recently used list.", diff --git a/scripts/createVanillaZips.py b/scripts/createVanillaZips.py index 71c34db..b88505a 100644 --- a/scripts/createVanillaZips.py +++ b/scripts/createVanillaZips.py @@ -6,7 +6,7 @@ from shutil import copytree TMP_PATH = "/tmp/jacobsjo/createVanillaZips/" -UPDATE_1_20_PATH = TMP_PATH + "data/minecraft/datapacks/update_1_20/" +DATAPACK_PATH = TMP_PATH + "data/minecraft/datapacks/" REQUIRED_DATA_TYPES = [ "worldgen/world_preset", @@ -36,6 +36,7 @@ "structures/village/savanna/zombie/town_centers/", "structures/village/snowy/zombie/town_centers/", "structures/village/taiga/zombie/town_centers/", + "structures/trial_chambers/corridor/end", "tags/worldgen/world_preset", "tags/worldgen/biome", "tags/worldgen/structure", @@ -46,10 +47,12 @@ ] REQUIRED_PATHS = ["data/minecraft/datapacks/update_1_20/pack.mcmeta"] +REQUIRED_PATHS = ["data/minecraft/datapacks/update_1_21/pack.mcmeta"] for path in REQUIRED_DATA_TYPES: REQUIRED_PATHS.append("data/minecraft/" + path) REQUIRED_PATHS.append("data/minecraft/datapacks/update_1_20/data/minecraft/" + path) + REQUIRED_PATHS.append("data/minecraft/datapacks/update_1_21/data/minecraft/" + path) for path in REQUIRED_ASSETS_TYPES: REQUIRED_PATHS.append("assets/minecraft/" + path) @@ -63,7 +66,7 @@ def download_and_extract(url: str): jar.extract(file, TMP_PATH) -def main(version: str, include_update_1_20: bool, suffix: str = ""): +def main(version: str, include_datapack: str = "", suffix: str = ""): # empty temp folder print("Emptying temp folder") emptyTmp() @@ -78,10 +81,10 @@ def main(version: str, include_update_1_20: bool, suffix: str = ""): copytree("vanilla_datapack_base/", TMP_PATH, dirs_exist_ok=True) # zip back up - print("Creating fip files") - if include_update_1_20: - shutil.make_archive("public/vanilla_datapacks/update_1_20", 'zip', UPDATE_1_20_PATH) - shutil.rmtree(UPDATE_1_20_PATH) + print("Creating zip files") + if include_datapack != "": + shutil.make_archive("public/vanilla_datapacks/" + include_datapack, 'zip', DATAPACK_PATH + include_datapack + "/") + shutil.rmtree(DATAPACK_PATH + include_datapack + "/") shutil.make_archive("public/vanilla_datapacks/vanilla" + suffix, 'zip', TMP_PATH) @@ -94,5 +97,5 @@ def emptyTmp(): if __name__ == "__main__": - main('1.19.4', True, "_1_19") - main('1.20', False, "_1_20") + main('1.19.4', "update_1_20", "_1_19") + main('23w45a', "update_1_21", "_1_20") diff --git a/src/components/dropdown/OpenDropdown.vue b/src/components/dropdown/OpenDropdown.vue index 311030f..7f8b5b8 100644 --- a/src/components/dropdown/OpenDropdown.vue +++ b/src/components/dropdown/OpenDropdown.vue @@ -138,8 +138,13 @@ async function loadFolder(event: MouseEvent) { const PRESET_DATAPACKS = computed(() => { const presets = [] - if (settingsStore.mc_version === "1_19"){ - presets.push({ image: UNKOWN_PACK, message_key: "dropdown.add.built_in.update_1_20", url: "vanilla_datapacks/update_1_20.zip" }) + switch (settingsStore.mc_version){ + case "1_19": + presets.push({ image: UNKOWN_PACK, message_key: "dropdown.add.built_in.update_1_20", url: "vanilla_datapacks/update_1_20.zip" }) + break + case "1_20_2": + presets.push({ image: UNKOWN_PACK, message_key: "dropdown.add.built_in.update_1_21", url: "vanilla_datapacks/update_1_21.zip" }) + break } return presets }) diff --git a/vanilla_datapack_base/data/minecraft/datapacks/update_1_21/data/c/worldgen/structure_icons.json b/vanilla_datapack_base/data/minecraft/datapacks/update_1_21/data/c/worldgen/structure_icons.json new file mode 100644 index 0000000..afc7788 --- /dev/null +++ b/vanilla_datapack_base/data/minecraft/datapacks/update_1_21/data/c/worldgen/structure_icons.json @@ -0,0 +1,3 @@ +{ + "minecraft:trial_chambers": {"item": "minecraft:trial_spawner"} +} \ No newline at end of file