mc: allow for any values of LEVEL_TYPE to support various mods

This commit is contained in:
Geoff Bourne
2018-10-06 08:08:13 -05:00
parent b88ae49c3b
commit 6e3761ae91
2 changed files with 2 additions and 17 deletions

View File

@@ -623,7 +623,7 @@ environment variable set to `false`, such as
### Level Type and Generator Settings
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
be configured by setting `LEVEL_TYPE` to
be configured by setting `LEVEL_TYPE` to an expected type, such as
* DEFAULT
* FLAT

View File

@@ -78,22 +78,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
setServerProp "online-mode" "$ONLINE_MODE"
setServerProp "allow-flight" "$ALLOW_FLIGHT"
if [ -n "$LEVEL_TYPE" ]; then
# normalize to uppercase
LEVEL_TYPE=$( echo ${LEVEL_TYPE} | tr '[:lower:]' '[:upper:]' )
echo "Setting level type to $LEVEL_TYPE"
# check for valid values and only then set
case $LEVEL_TYPE in
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED|BIOMESOP|RTG|RWG|BUFFET)
setServerProp "level-type" "$LEVEL_TYPE"
;;
*)
echo "Invalid LEVEL_TYPE: $LEVEL_TYPE"
exit 1
;;
esac
fi
setServerProp "level-type" "${LEVEL_TYPE^^}"
if [ -n "$DIFFICULTY" ]; then
case $DIFFICULTY in