Allow specify paper build and don't use legacy gamemode and difficulty (#503)

This commit is contained in:
orblazer authored and GitHub committed 2020-04-22 07:06:57 -05:00
1 parent e9b1332119
commit c2846fc586
3 files changed
+60 -25

No files matched your search

+11 -8
View File
@@ -230,7 +230,7 @@ up:
This is the easiest way if you are using an ephemeral `/data` filesystem, This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option. or downloading a world with the `WORLD` option.
There are two additional volumes that can be mounted; `/mods` and `/config`. There are two additional volumes that can be mounted; `/mods` and `/config`.
Any files in either of these filesystems will be copied over to the main Any files in either of these filesystems will be copied over to the main
`/data` filesystem before starting Minecraft. `/data` filesystem before starting Minecraft.
@@ -374,7 +374,7 @@ up:
This is the easiest way if you are using an ephemeral `/data` filesystem, This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option. or downloading a world with the `WORLD` option.
There is one additional volume that can be mounted; `/plugins`. There is one additional volume that can be mounted; `/plugins`.
Any files in this filesystem will be copied over to the main Any files in this filesystem will be copied over to the main
`/data/plugins` filesystem before starting Minecraft. `/data/plugins` filesystem before starting Minecraft.
@@ -386,6 +386,9 @@ in either persistent volumes or a downloadable archive.
Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line. Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line.
By default the container will run the latest build of [Paper server](https://papermc.io/downloads)
but you can also choose to run a specific build with `-e PAPERBUILD=205`.
docker run -d -v /path/on/host:/data \ docker run -d -v /path/on/host:/data \
-e TYPE=PAPER -e VERSION=1.9.4 \ -e TYPE=PAPER -e VERSION=1.9.4 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
@@ -436,7 +439,7 @@ up:
This is the easiest way if you are using an ephemeral `/data` filesystem, This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option. or downloading a world with the `WORLD` option.
There is one additional volume that can be mounted; `/plugins`. There is one additional volume that can be mounted; `/plugins`.
Any files in this filesystem will be copied over to the main Any files in this filesystem will be copied over to the main
`/data/plugins` filesystem before starting Minecraft. `/data/plugins` filesystem before starting Minecraft.
@@ -459,8 +462,8 @@ but note the following additional steps needed...
You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment
variable. An FTB/CurseForge server modpack is available together with its respective variable. An FTB/CurseForge server modpack is available together with its respective
client modpack on https://www.feed-the-beast.com under "Additional Files." Similar you can client modpack on <https://www.feed-the-beast.com> under "Additional Files." Similar you can
locate the modpacks for CurseForge at https://www.curseforge.com/minecraft/modpacks . locate the modpacks for CurseForge at <https://www.curseforge.com/minecraft/modpacks> .
Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line. Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line.
@@ -498,7 +501,7 @@ To use these packs you will need to:
- Specify the manifest location with env var `MANIFEST=/data/FeedTheBeast/manifest` - Specify the manifest location with env var `MANIFEST=/data/FeedTheBeast/manifest`
- Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast` - Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast`
An example of the latter would be to use https://github.com/AllTheMods/Server-Scripts An example of the latter would be to use <https://github.com/AllTheMods/Server-Scripts>
There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into
`/data/FeedTheBeast`, taking care to update `settings.cfg` to specify your desired version `/data/FeedTheBeast`, taking care to update `settings.cfg` to specify your desired version
of minecraft and forge. You can do this in the cli with something like: of minecraft and forge. You can do this in the cli with something like:
@@ -596,7 +599,7 @@ up:
This is the easiest way if you are using an ephemeral `/data` filesystem, This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option. or downloading a world with the `WORLD` option.
There are two additional volumes that can be mounted; `/mods` and `/config`. There are two additional volumes that can be mounted; `/mods` and `/config`.
Any files in either of these filesystems will be copied over to the main Any files in either of these filesystems will be copied over to the main
`/data` filesystem before starting Minecraft. `/data` filesystem before starting Minecraft.
@@ -995,7 +998,7 @@ Allows users to use flight on your server while in Survival mode, if they have a
-e ALLOW_FLIGHT=TRUE|FALSE -e ALLOW_FLIGHT=TRUE|FALSE
### Other server property mappings: ### Other server property mappings
Environment Variable | Server Property Environment Variable | Server Property
---------------------|----------------- ---------------------|-----------------
+5 -3
View File
@@ -2,10 +2,12 @@
. /start-utils . /start-utils
export SERVER=paper_server-${VANILLA_VERSION}.jar PAPERBUILD=${PAPERBUILD:-LATEST}
export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download} downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download}
log "Downloading Paper $VANILLA_VERSION from $downloadUrl ..." log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..."
curl -fsSL -o "$SERVER" "$downloadUrl" curl -fsSL -o "$SERVER" "$downloadUrl"
if [ ! -f "$SERVER" ]; then if [ ! -f "$SERVER" ]; then
log "ERROR: failed to download from $downloadUrl (status=$?)" log "ERROR: failed to download from $downloadUrl (status=$?)"
+44 -14
View File
@@ -81,16 +81,32 @@ function customizeServerProps {
if [ -n "$DIFFICULTY" ]; then if [ -n "$DIFFICULTY" ]; then
case $DIFFICULTY in case $DIFFICULTY in
peaceful|0) peaceful|0)
DIFFICULTY=0 if versionLessThan 1.13; then
DIFFICULTY=0
else
DIFFICULTY=peaceful
fi
;; ;;
easy|1) easy|1)
DIFFICULTY=1 if versionLessThan 1.13; then
DIFFICULTY=1
else
DIFFICULTY=easy
fi
;; ;;
normal|2) normal|2)
DIFFICULTY=2 if versionLessThan 1.13; then
DIFFICULTY=2
else
DIFFICULTY=normal
fi
;; ;;
hard|3) hard|3)
DIFFICULTY=3 if versionLessThan 1.13; then
DIFFICULTY=3
else
DIFFICULTY=hard
fi
;; ;;
*) *)
log "DIFFICULTY must be peaceful, easy, normal, or hard." log "DIFFICULTY must be peaceful, easy, normal, or hard."
@@ -104,19 +120,33 @@ function customizeServerProps {
log "Setting mode" log "Setting mode"
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' ) MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
case $MODE_LC in case $MODE_LC in
0|1|2|3) su*|0)
if versionLessThan 1.13; then
MODE=0
else
MODE=survival
fi
;; ;;
su*) c*|1)
MODE=0 if versionLessThan 1.13; then
MODE=1
else
MODE=creative
fi
;; ;;
c*) a*|2)
MODE=1 if versionLessThan 1.13; then
MODE=2
else
MODE=adventure
fi
;; ;;
a*) sp*|3)
MODE=2 if versionLessThan 1.13; then
;; MODE=3
sp*) else
MODE=3 MODE=spectator
fi
;; ;;
*) *)
log "ERROR: Invalid game mode: $MODE" log "ERROR: Invalid game mode: $MODE"