Fixed version comparisons when using SPONGEVANILLA (#1455)

Fixes #1452
This commit is contained in:
Geoff Bourne 2022-04-02 15:38:13 -05:00 committed by GitHub
parent 5c0cf11bfe
commit e0b4a819b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 4 deletions

View File

@ -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. 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. 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): 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 -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server:java8-multiarch
You can also choose to use the `EXPERIMENTAL` branch. You can also choose to use the `EXPERIMENTAL` branch.

View File

@ -24,12 +24,14 @@ esac
if [ -z $SPONGEVERSION ]; then if [ -z $SPONGEVERSION ]; then
log "Choosing Version for Sponge" log "Choosing Version for Sponge"
if [ "$SPONGEBRANCH" == "stable" ]; then 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 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
fi fi
VANILLA_VERSION="$SPONGEVERSION"
export VANILLA_VERSION
export SERVER="spongevanilla-$SPONGEVERSION.jar" export SERVER="spongevanilla-$SPONGEVERSION.jar"
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then

View File

@ -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

View File

@ -0,0 +1 @@
mc-image-helper assert propertyEquals --file=server.properties --property=difficulty --expect=0