From e0b4a819b1a533609197ef88035ca8f84eab9528 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 2 Apr 2022 15:38:13 -0500 Subject: [PATCH] Fixed version comparisons when using SPONGEVANILLA (#1455) Fixes #1452 --- README.md | 3 +-- scripts/start-deploySpongeVanilla | 6 ++++-- .../docker-compose.yml | 15 +++++++++++++++ .../spongevanilla_version_compare/verify.sh | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 tests/setuponlytests/spongevanilla_version_compare/docker-compose.yml create mode 100644 tests/setuponlytests/spongevanilla_version_compare/verify.sh diff --git a/README.md b/README.md index 57536476..764e1ffd 100644 --- a/README.md +++ b/README.md @@ -609,11 +609,10 @@ Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your com 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. -Because the Minecraft version of the SpongeVanilla server cannot be automatically guessed, the `VERSION` should also be set accordingly. Beware that current [Sponge](https://www.spongepowered.org) `STABLE` versions for Minecraft 1.12 require using [the Java 8 tag](#running-minecraft-server-on-different-java-version): - docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA -e VERSION=1.12.2 \ + docker run -d -v /path/on/host:/data -e TYPE=SPONGEVANILLA \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server:java8-multiarch You can also choose to use the `EXPERIMENTAL` branch. diff --git a/scripts/start-deploySpongeVanilla b/scripts/start-deploySpongeVanilla index d6a0ec39..07e88183 100755 --- a/scripts/start-deploySpongeVanilla +++ b/scripts/start-deploySpongeVanilla @@ -24,12 +24,14 @@ esac if [ -z $SPONGEVERSION ]; then log "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'` + 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'` + SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version'` fi fi +VANILLA_VERSION="$SPONGEVERSION" +export VANILLA_VERSION export SERVER="spongevanilla-$SPONGEVERSION.jar" if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then diff --git a/tests/setuponlytests/spongevanilla_version_compare/docker-compose.yml b/tests/setuponlytests/spongevanilla_version_compare/docker-compose.yml new file mode 100644 index 00000000..8999a9c7 --- /dev/null +++ b/tests/setuponlytests/spongevanilla_version_compare/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3" + +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: "SPONGEVANILLA" + SPONGEVERSION: "1.12.2-7.3.1-RC391" + DIFFICULTY: "0" + + volumes: + - ./data:/data diff --git a/tests/setuponlytests/spongevanilla_version_compare/verify.sh b/tests/setuponlytests/spongevanilla_version_compare/verify.sh new file mode 100644 index 00000000..74b001b5 --- /dev/null +++ b/tests/setuponlytests/spongevanilla_version_compare/verify.sh @@ -0,0 +1 @@ +mc-image-helper assert propertyEquals --file=server.properties --property=difficulty --expect=0