mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
SpongeVanilla integration and JSON check fix
This commit is contained in:
parent
ee5a95baa8
commit
f178c6c0a1
@ -44,6 +44,6 @@ ENTRYPOINT [ "/start" ]
|
|||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
MOTD="A Minecraft Server Powered by Docker" \
|
MOTD="A Minecraft Server Powered by Docker" \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE LEVEL=world PVP=true \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \
|
||||||
DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true
|
||||||
|
@ -73,6 +73,10 @@ case "$TYPE" in
|
|||||||
exec /start-deployVanilla $@
|
exec /start-deployVanilla $@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
SPONGEVANILLA|spongevanilla)
|
||||||
|
exec /start-deploySpongeVanilla $@
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Invalid type: '$TYPE'"
|
echo "Invalid type: '$TYPE'"
|
||||||
echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, SPONGEVANILLA"
|
echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, SPONGEVANILLA"
|
||||||
|
37
minecraft-server/start-deploySpongeVanilla
Executable file
37
minecraft-server/start-deploySpongeVanilla
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export TYPE=spongevanilla
|
||||||
|
|
||||||
|
# Parse branch
|
||||||
|
echo "Choosing branch for Sponge"
|
||||||
|
case "$SPONGEBRANCH" in
|
||||||
|
|
||||||
|
EXPERIMENTAL|experimental|BLEEDING|bleeding)
|
||||||
|
SPONGEBRANCH=bleeding
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
SPONGEBRANCH=stable
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If not SPONGEVERSION selected, detect last version on selected branch
|
||||||
|
if [ -z $SPONGEVERSION ]; then
|
||||||
|
echo "Choosing Version for Sponge"
|
||||||
|
if [ "$SPONGEBRANCH" == "stable" ]; then
|
||||||
|
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
|
||||||
|
else
|
||||||
|
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version'`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||||
|
|
||||||
|
if [ ! -e $SERVER ]; then
|
||||||
|
echo "Downloading $SERVER ..."
|
||||||
|
wget -q https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Continue to Final Setup
|
||||||
|
exec /start-finalSetup01World $@
|
@ -24,12 +24,17 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||||
for j in *.json; do
|
if [[ -z "ls *.json" ]]; then
|
||||||
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
echo "Checking JSON files"
|
||||||
echo "Fixing JSON $j"
|
for j in *.json; do
|
||||||
echo '[]' > $j
|
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
||||||
fi
|
echo "Fixing JSON $j"
|
||||||
done
|
echo '[]' > $j
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "Skipping JSON check. No files present."
|
||||||
|
fi
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
mkdir -p /data/mods
|
mkdir -p /data/mods
|
||||||
|
Loading…
Reference in New Issue
Block a user