mc: added allow-flight option

This commit is contained in:
Geoff Bourne 2018-04-14 13:01:34 -05:00
parent 2627317e03
commit 959bdeef54
2 changed files with 12 additions and 0 deletions

View File

@ -723,6 +723,12 @@ By default, server checks connecting players against Minecraft's account databas
docker run -d -e ONLINE_MODE=FALSE ...
### Allow flight
Allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.
-e ALLOW_FLIGHT=TRUE|FALSE
## Miscellaneous Options
### Memory Limit

View File

@ -5,6 +5,11 @@ function setServerProp {
local prop=$1
local var=$2
if [ -n "$var" ]; then
# normalize booleans
case ${var^^} in
TRUE|FALSE)
var=${var,,} ;;
esac
echo "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
sed -i "/^${prop}\s*=/ c ${prop}=${var}" $SERVER_PROPERTIES
else
@ -55,6 +60,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
setServerProp "pvp" "$PVP"
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
setServerProp "online-mode" "$ONLINE_MODE"
setServerProp "allow-flight" "$ALLOW_FLIGHT"
if [ -n "$LEVEL_TYPE" ]; then
# normalize to uppercase