Compare commits

...

4 Commits

Author SHA1 Message Date
Geoff Bourne
621962ad9c Always populate ops.txt to allow for additive config
For #283
2019-09-08 17:22:20 -05:00
Aurélien Bertron
5c238af3df Add spawn protection setting (#386) 2019-09-08 16:40:45 -05:00
Geoff Bourne
8e148095f0 Adding link for github README 2019-08-24 11:12:41 -05:00
DocQuantum
3c55a05b1c Added ability to add resource-pack from environment vars (#379) 2019-08-24 10:38:59 -05:00
4 changed files with 25 additions and 4 deletions

View File

@@ -61,6 +61,7 @@ ENV UID=1000 GID=1000 \
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \ JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \ TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \ PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
RESOURCE_PACK= RESOURCE_PACK_SHA1= \
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \ LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_" REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"

View File

@@ -9,6 +9,8 @@ This docker image provides a Minecraft Server that will automatically download t
version at startup. You can also run/upgrade to any specific version or the version at startup. You can also run/upgrade to any specific version or the
latest snapshot. See the *Versions* section below for more information. latest snapshot. See the *Versions* section below for more information.
[![Click for more docs](https://i.imgur.com/jS02ebD.png)](https://github.com/itzg/docker-minecraft-server/blob/master/README.md)
To simply use the latest stable version, run To simply use the latest stable version, run
docker run -d -p 25565:25565 --name mc itzg/minecraft-server docker run -d -p 25565:25565 --name mc itzg/minecraft-server
@@ -821,6 +823,12 @@ Determines if monsters will be spawned.
Determines if villagers will be spawned. Determines if villagers will be spawned.
docker run -d -e SPAWN_NPCS=true docker run -d -e SPAWN_NPCS=true
### Set spawn protection
Sets the area that non-ops can not edit (0 to disable)
docker run -d -e SPAWN_PROTECTION=0
### View Distance ### View Distance
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
@@ -894,6 +902,14 @@ For example (just the `-e` bits):
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;' -e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
### Custom Server Resource Pack
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
docker run -d -e 'RESROUCE_PACK=http\://link.com/to/pack.zip?\=1' -e 'RESOURCE_PACK_SHA1=d5db29cd03a2ed055086cef9c31c252b4587d6d0'
**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal.
### World Save Name ### World Save Name
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option, You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
@@ -1033,4 +1049,4 @@ pass that at the end of `docker run` after the image name or set `-e CONSOLE=FAL
### Explicitly disable GUI ### Explicitly disable GUI
Some older servers get confused and think that the GUI interface is enabled. You can explicitly Some older servers get confused and think that the GUI interface is enabled. You can explicitly
disable that by passing `-e GUI=FALSE`. disable that by passing `-e GUI=FALSE`.

View File

@@ -49,6 +49,7 @@ function customizeServerProps {
setServerProp "spawn-animals" "$SPAWN_ANIMALS" setServerProp "spawn-animals" "$SPAWN_ANIMALS"
setServerProp "spawn-monsters" "$SPAWN_MONSTERS" setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
setServerProp "spawn-npcs" "$SPAWN_NPCS" setServerProp "spawn-npcs" "$SPAWN_NPCS"
setServerProp "spawn-protection" "$SPAWN_PROTECTION"
setServerProp "generate-structures" "$GENERATE_STRUCTURES" setServerProp "generate-structures" "$GENERATE_STRUCTURES"
setServerProp "view-distance" "$VIEW_DISTANCE" setServerProp "view-distance" "$VIEW_DISTANCE"
setServerProp "hardcore" "$HARDCORE" setServerProp "hardcore" "$HARDCORE"
@@ -70,6 +71,8 @@ function customizeServerProps {
setServerProp "online-mode" "$ONLINE_MODE" setServerProp "online-mode" "$ONLINE_MODE"
setServerProp "allow-flight" "$ALLOW_FLIGHT" setServerProp "allow-flight" "$ALLOW_FLIGHT"
setServerProp "level-type" "${LEVEL_TYPE^^}" setServerProp "level-type" "${LEVEL_TYPE^^}"
setServerProp "resource-pack" "$RESOURCE_PACK"
setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1"
if [ -n "$DIFFICULTY" ]; then if [ -n "$DIFFICULTY" ]; then
case $DIFFICULTY in case $DIFFICULTY in

View File

@@ -2,9 +2,10 @@
. /start-utils . /start-utils
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then if [ -n "$OPS" ]; then
echo "Setting ops" echo "Setting/adding ops"
echo $OPS | awk -v RS=, '{print}' >> ops.txt rm -rf ops.txt.converted
echo $OPS | awk -v RS=, '{print}' > ops.txt
fi fi
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then