From 2493829f0f50b321e00fd5be996a82ebb032324d Mon Sep 17 00:00:00 2001 From: Eric Heinzl <38140317+xPand4B@users.noreply.github.com> Date: Sun, 20 Aug 2023 12:04:21 +0200 Subject: [PATCH] GH-34 - Added MC 1.20.* support (#35) * GH-34 - Updated pack_format version * GH-34 - Added helper to change location for different datapack versions --- helper.sh | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++ pack.mcmeta | 2 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 helper.sh diff --git a/helper.sh b/helper.sh new file mode 100644 index 0000000..68395b8 --- /dev/null +++ b/helper.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +red=`tput setaf 1` +green=`tput setaf 2` +reset=`tput sgr0` + +# SELECTION +##################################### +echo "" +echo "[${green}1${reset}] Change towers to 'regular'" +echo "[${green}2${reset}] Change towers to 'fwaystones'" +echo "[${green}3${reset}] Change towers to 'waystones'" + +echo "" +read -p "Select your option [${green}1${reset}/${green}2${reset}/${green}3${reset}]: " input + +# VARIABLES +##################################### +templatePool="data/totw_reworked/worldgen/template_pool" + +derelict="derelict" +derelictGrass="derelict_grass" +ice="ice" +jungle="jungle" +ocean="ocean" +oceanWarm="ocean_warm" +regular="regular" + +topFileName="top.json" + +intendation=" " +regularPrefix="" +fabricWaystonesPrefix="fwaystones_" +waystonesPrefix="waystone_" + +function replaceLocation() { + fileName="data/totw_reworked/worldgen/template_pool/$2/$topFileName" + + oldLocation="\"location\": " + newLocation="$intendation\"location\": \"totw_reworked:$2/$1$2_tower_top\"," + + #sed -i '/"location"/c\\t\t\t\t"location": "totw_reworked:derelict\/fwaystones_derelict_tower_top",' data/totw_reworked/worldgen/template_pool/derelict/top.json + sed -i "/$oldLocation/c\\$newLocation" $fileName +} + +# REGULAR TOWERS +##################################### +if [ $input -eq 1 ]; then + replaceLocation "$regularPrefix" "$derelict" + replaceLocation "$regularPrefix" "$derelictGrass" + replaceLocation "$regularPrefix" "$ice" + replaceLocation "$regularPrefix" "$jungle" + replaceLocation "$regularPrefix" "$ocean" + replaceLocation "$regularPrefix" "$oceanWarm" + replaceLocation "$regularPrefix" "$regular" +fi + +# FABRIC WAYSTONES TOWERS +##################################### +if [ $input -eq 2 ]; then + replaceLocation "$fabricWaystonesPrefix" "$derelict" + replaceLocation "$fabricWaystonesPrefix" "$derelictGrass" + replaceLocation "$fabricWaystonesPrefix" "$ice" + replaceLocation "$fabricWaystonesPrefix" "$jungle" + replaceLocation "$fabricWaystonesPrefix" "$ocean" + replaceLocation "$fabricWaystonesPrefix" "$oceanWarm" + replaceLocation "$fabricWaystonesPrefix" "$regular" +fi + +# WAYSTONES TOWERS +##################################### +if [ $input -eq 3 ]; then + replaceLocation "$waystonesPrefix" "$derelict" + replaceLocation "$waystonesPrefix" "$derelictGrass" + replaceLocation "$waystonesPrefix" "$ice" + replaceLocation "$waystonesPrefix" "$jungle" + replaceLocation "$waystonesPrefix" "$ocean" + replaceLocation "$waystonesPrefix" "$oceanWarm" + replaceLocation "$waystonesPrefix" "$regular" +fi \ No newline at end of file diff --git a/pack.mcmeta b/pack.mcmeta index 04c585a..23e2efe 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 12, + "pack_format": 15, "description": [ { "text": "Adds Breath Of The Wild-like towers to make exploring a bit more fun!",