diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index bd14043c..ec8686e9 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -44,6 +44,6 @@ ENTRYPOINT [ "/start" ] ENV UID=1000 GID=1000 \ MOTD="A Minecraft Server Powered by Docker" \ JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ - TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE LEVEL=world PVP=true \ - DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ + TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= LEVEL=world \ + 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 diff --git a/minecraft-server/start-configuration b/minecraft-server/start-configuration index f045bf08..10ce5da7 100755 --- a/minecraft-server/start-configuration +++ b/minecraft-server/start-configuration @@ -73,6 +73,10 @@ case "$TYPE" in exec /start-deployVanilla $@ ;; + SPONGEVANILLA|spongevanilla) + exec /start-deploySpongeVanilla $@ + ;; + *) echo "Invalid type: '$TYPE'" echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, SPONGEVANILLA" diff --git a/minecraft-server/start-deploySpongeVanilla b/minecraft-server/start-deploySpongeVanilla new file mode 100755 index 00000000..fd4e781c --- /dev/null +++ b/minecraft-server/start-deploySpongeVanilla @@ -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 $@ diff --git a/minecraft-server/start-minecraftFinalSetup b/minecraft-server/start-minecraftFinalSetup index dba9ad33..a4e5c0fb 100755 --- a/minecraft-server/start-minecraftFinalSetup +++ b/minecraft-server/start-minecraftFinalSetup @@ -24,12 +24,17 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then fi # Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades) -for j in *.json; do - if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then - echo "Fixing JSON $j" - echo '[]' > $j - fi -done +if [[ -z "ls *.json" ]]; then + echo "Checking JSON files" + for j in *.json; do + if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then + echo "Fixing JSON $j" + echo '[]' > $j + fi + done +else + echo "Skipping JSON check. No files present." +fi # If any modules have been provided, copy them over mkdir -p /data/mods