From e9b13321197fc77ba18648a82635c425878dd1f8 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 21 Apr 2020 18:30:48 -0500 Subject: [PATCH] Added support for Magma servers For #497 --- README.md | 8 ++++++++ start-configuration | 4 ++++ start-deployBukkitSpigot | 1 + start-deployCustom | 2 ++ start-magma | 18 ++++++++++++++++++ start-minecraftFinalSetup | 2 +- 6 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 start-magma diff --git a/README.md b/README.md index 409120c2..073c648e 100644 --- a/README.md +++ b/README.md @@ -444,6 +444,14 @@ This works well if you want to have a common set of plugins in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive. +## Running a Magma server + +A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with + + -e TYPE=MAGMA + +> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2" + ## Running a Server with a Feed-The-Beast (FTB) / CurseForge modpack Enable this server mode by adding a `-e TYPE=FTB` or `-e TYPE=CURSEFORGE` to your command-line, diff --git a/start-configuration b/start-configuration index a79f7471..15c19ca1 100644 --- a/start-configuration +++ b/start-configuration @@ -106,6 +106,10 @@ case "${TYPE^^}" in exec /start-validateCurseInstance "$@" ;; + MAGMA) + exec /start-magma "$@" + ;; + *) log "Invalid type: '$TYPE'" log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA" diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index cfec08cf..05e29994 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -82,6 +82,7 @@ fi # Normalize on Spigot for operations below export TYPE=SPIGOT +export SKIP_LOG4J_CONFIG=true # Continue to Final Setup exec /start-finalSetup01World $@ diff --git a/start-deployCustom b/start-deployCustom index 0d64f912..5b7e6f8d 100644 --- a/start-deployCustom +++ b/start-deployCustom @@ -25,5 +25,7 @@ else exit 2 fi +export SKIP_LOG4J_CONFIG=true + # Continue to Final Setup exec /start-finalSetup01World $@ diff --git a/start-magma b/start-magma new file mode 100755 index 00000000..70b201f4 --- /dev/null +++ b/start-magma @@ -0,0 +1,18 @@ +#!/bin/bash + +. /start-utils + +export SERVER="/data/magma-server-${VANILLA_VERSION}.jar" + +# Always download since new updates of each base version are published frequently +if ! curl -o /data/magma-server-${VANILLA_VERSION}.jar -fsSL \ + https://api.magmafoundation.org/api/resources/Magma/${VANILLA_VERSION}/stable/latest/download; then + log "ERROR unable to download version ${VANILLA_VERSION} of Magma" + log " Check https://magmafoundation.org/ for available versions" + exit 1 +fi + +export SKIP_LOG4J_CONFIG=true + +# Continue to Final Setup +exec /start-finalSetup01World $@ diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index ff20ceea..b89f9718 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -27,7 +27,7 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then fi fi -if [ ${TYPE} != "SPIGOT" ]; then +if ! isTrue ${SKIP_LOG4J_CONFIG}; then # Set up log configuration LOGFILE="/data/log4j2.xml" if [ ! -e "$LOGFILE" ]; then