mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-08-04 14:42:17 +00:00
mc: allow for any values of LEVEL_TYPE to support various mods
This commit is contained in:
@@ -623,7 +623,7 @@ environment variable set to `false`, such as
|
|||||||
### Level Type and Generator Settings
|
### Level Type and Generator Settings
|
||||||
|
|
||||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
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
|
* DEFAULT
|
||||||
* FLAT
|
* FLAT
|
||||||
|
|||||||
@@ -78,22 +78,7 @@ if [ ! -e $SERVER_PROPERTIES ]; then
|
|||||||
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
||||||
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^^}"
|
||||||
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
|
|
||||||
|
|
||||||
if [ -n "$DIFFICULTY" ]; then
|
if [ -n "$DIFFICULTY" ]; then
|
||||||
case $DIFFICULTY in
|
case $DIFFICULTY in
|
||||||
|
|||||||
Reference in New Issue
Block a user