Skip to content

Commit

Permalink
GH-34 - Added MC 1.20.* support (#35)
Browse files Browse the repository at this point in the history
* GH-34 - Updated pack_format version

* GH-34 - Added helper to change location for different datapack versions
  • Loading branch information
xPand4B authored Aug 20, 2023
1 parent b8d6fbc commit 2493829
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
80 changes: 80 additions & 0 deletions helper.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion pack.mcmeta
Original file line number Diff line number Diff line change
@@ -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!",
Expand Down

0 comments on commit 2493829

Please sign in to comment.