Skip to content

Commit

Permalink
Ensure datapacks cleanup doesn't remove vanillatweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg committed Jul 1, 2023
1 parent 4a942db commit 66a2394
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
1 change: 1 addition & 0 deletions notes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.bkp
Binary file modified notes/start-script-flow.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions scripts/start-setupDatapack
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e -o pipefail

: "${VANILLATWEAKS_FILE:=}"
: "${VANILLATWEAKS_SHARECODE:=}"
: "${REMOVE_OLD_DATAPACKS:=false}"
: "${DATAPACKS_FILE:=}"
: "${REMOVE_OLD_DATAPACKS_DEPTH:=1} "
Expand All @@ -11,6 +13,14 @@ set -e -o pipefail
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x

if [[ ${VANILLATWEAKS_FILE} || ${VANILLATWEAKS_SHARECODE} ]]; then
mc-image-helper vanillatweaks \
--output-directory="/data" \
--world-subdir="${LEVEL:-world}" \
--share-codes="$VANILLATWEAKS_SHARECODE" \
--pack-files="$VANILLATWEAKS_FILE"
fi

out_dir=/data/${LEVEL:-world}/datapacks

# Remove old datapacks
Expand Down
19 changes: 0 additions & 19 deletions scripts/start-setupVanillaTweaks

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/start-setupWorld
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
count=$(echo "$baseDirs" | wc -l)
if [[ $count -gt 1 ]]; then
baseDirsNoSpigotSuffix=$(echo "$baseDirs" | sed -re 's:(_nether|_the_end)/?$::' | sort -u)
if [ $(echo "$baseDirsNoSpigotSuffix" | wc -l) -eq 1 ]; then
if [ "$(echo "$baseDirsNoSpigotSuffix" | wc -l)" -eq 1 ]; then
baseDir="$baseDirsNoSpigotSuffix"
baseName=$(basename "$baseDir")
log "Found Spigot naming conventions, taking $baseName as main dimension"
Expand Down Expand Up @@ -123,4 +123,4 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
fi
fi

exec "${SCRIPTS:-/}start-setupVanillaTweaks" "$@"
exec "${SCRIPTS:-/}start-setupDatapack" "$@"

0 comments on commit 66a2394

Please sign in to comment.