mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 13:52:27 +00:00
Allow non-ZIP urls for download
Add directory rename for Spigot
This commit is contained in:
parent
a313c03fff
commit
4ab31a049b
1 changed files with 35 additions and 18 deletions
|
@ -33,19 +33,15 @@ esac
|
|||
|
||||
cd /data
|
||||
|
||||
echo "Checking minecraft / forge type information."
|
||||
echo "Checking type information."
|
||||
case "$TYPE" in
|
||||
VANILLA)
|
||||
SERVER="minecraft_server.$VANILLA_VERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER
|
||||
fi
|
||||
*BUKKIT|*bukkit|SPIGOT|spigot)
|
||||
TYPE=SPIGOT
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
FORGE|forge)
|
||||
# norm := the official Minecraft version as Forge is tracking it. dropped the third part starting with 1.8
|
||||
TYPE=FORGE
|
||||
case $VANILLA_VERSION in
|
||||
1.7.*)
|
||||
norm=$VANILLA_VERSION
|
||||
|
@ -87,11 +83,26 @@ case "$TYPE" in
|
|||
fi
|
||||
;;
|
||||
|
||||
VANILLA|vanilla|)
|
||||
SERVER="minecraft_server.$VANILLA_VERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid type: '$TYPE'"
|
||||
echo "Must be: VANILLA, FORGE, SPIGOT"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# If supplied with a URL for a world, download it and unpack
|
||||
case "X$WORLD" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
X[Hh][Tt][Tt][Pp]*)
|
||||
echo "Downloading world via HTTP"
|
||||
echo "$WORLD"
|
||||
wget -q -O - "$WORLD" > /data/world.zip
|
||||
|
@ -108,6 +119,12 @@ case "X$WORLD" in
|
|||
fi
|
||||
done
|
||||
fi
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
# Reorganise if a Spigot server
|
||||
echo "Moving End and Nether maps to Spigot location"
|
||||
[ -d "/data/world/DIM1" ] && mv -f "/data/world/DIM1" "/data/world_the_end"
|
||||
[ -d "/data/world/DIM-1" ] && mv -f "/data/world/DIM-1" "/data/world_nether"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
||||
|
|
Loading…
Reference in a new issue