Skip to content

Commit

Permalink
update 1.21 and trial chambers
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsjo committed Nov 8, 2023
1 parent aff33ac commit 4f2c3a9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.",
Expand Down
19 changes: 11 additions & 8 deletions scripts/createVanillaZips.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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)
Expand All @@ -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()
Expand All @@ -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)

Expand All @@ -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")
9 changes: 7 additions & 2 deletions src/components/dropdown/OpenDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"minecraft:trial_chambers": {"item": "minecraft:trial_spawner"}
}

0 comments on commit 4f2c3a9

Please sign in to comment.