mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 14:24:28 +00:00
Adding Minecraft -e options for the game mode and level seed
This commit is contained in:
parent
287185919a
commit
0337f9fac1
1 changed files with 26 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
case $VERSION in
|
||||
LATEST)
|
||||
|
@ -24,9 +24,34 @@ fi
|
|||
if [ -n "$MOTD" ]; then
|
||||
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$LEVEL" ]; then
|
||||
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$SEED" ]; then
|
||||
sed -i "/level-seed\s*=/ c level-seed=$SEED" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$MODE" ]; then
|
||||
case ${MODE,,?} in
|
||||
0|1|2|3)
|
||||
;;
|
||||
s*)
|
||||
MODE=0
|
||||
;;
|
||||
c*)
|
||||
MODE=1
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Invalid game mode: $MODE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
sed -i "/gamemode\s*=/ c gamemode=$MODE" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$OPS" ]; then
|
||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue