mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-14 06:12:27 +00:00
Merge pull request #184 from BinaryShock/spongeIntegration
Sponge integration
This commit is contained in:
commit
b9787182e6
5 changed files with 69 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -398,6 +398,21 @@ example:
|
|||
Note: The FTB server start script will also override other options,
|
||||
like `MOTD`.
|
||||
|
||||
## Running a SpongeVanilla server
|
||||
|
||||
Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line.
|
||||
By default the container will run the latest `STABLE` version.
|
||||
If you want to run a specific version, you can add `-e SPONGEVERSION=1.11.2-6.1.0-BETA-19` to your command-line.
|
||||
|
||||
docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
You can also choose to use the `EXPERIMENTAL` branch.
|
||||
Just change it with `SPONGEBRANCH`, such as:
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e TYPE=SPONGEVANILLA -e SPONGEBRANCH=EXPERIMENTAL ...
|
||||
|
||||
## Using Docker Compose
|
||||
|
||||
Rather than type the server options below, the port mappings above, etc
|
||||
|
|
|
@ -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"
|
||||
|
|
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
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue