fix renaming a world

This commit is contained in:
Xathon 2022-04-12 03:32:58 +02:00
parent 168454eaa6
commit 12a6994053

6
msctl
View File

@ -2872,9 +2872,11 @@ case "$COMMAND" in
# Rename the world. # Rename the world.
printf "Renaming Minecraft world: $1" printf "Renaming Minecraft world: $1"
mkdir -p "$WORLDS_LOCATION/$2" mkdir -p "$WORLDS_LOCATION/$2"
mv $WORLDS_LOCATION/$1 $WORLDS_LOCATION/$2 mv $WORLDS_LOCATION/$1/* $WORLDS_LOCATION/$2
rm -r $WORLDS_LOCATION/$1
if [ -d $WORLDS_LOCATION/$2/$1 ]; then if [ -d $WORLDS_LOCATION/$2/$1 ]; then
mv $WORLDS_LOCATION/$2/$1 $WORLDS_LOCATION/$2/$2 mv $WORLDS_LOCATION/$2/$1/* $WORLDS_LOCATION/$2/$2
rm -r $WORLDS_LOCATION/$2/$1
fi fi
createWorld "$2" "$PORT" "$IP" createWorld "$2" "$PORT" "$IP"
printf ".\n" printf ".\n"