From e902c6f40fe7ab190a5345cae30a861c941ccf54 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Dec 2015 21:48:09 +1300 Subject: [PATCH] Set command blocks enabled on servers by default; improved use of http world download. --- minecraft-server/server.properties | 2 +- minecraft-server/start-minecraft.sh | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/minecraft-server/server.properties b/minecraft-server/server.properties index ddad1242..598256ac 100644 --- a/minecraft-server/server.properties +++ b/minecraft-server/server.properties @@ -21,7 +21,7 @@ online-mode=true resource-pack= pvp=true difficulty=1 -enable-command-block=false +enable-command-block=true player-idle-timeout=0 gamemode=0 max-players=20 diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index 86cf3068..ff7a2f35 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -89,8 +89,19 @@ esac # If supplied with a URL for a world, download it and unpack case "X$WORLD" in Xhttp*) + echo "Downloading world via HTTP" wget -q -O - $WORLD > /data/world.zip - unzip /data/world.zip + echo "Unzipping word" + unzip -q /data/world.zip + rm -f /data/world.zip + if [ ! -d /data/world ]; then + echo Renaming world directory... + for i in /data/*/level.dat; do + if [ -f $i ]; then + mv -f `dirname $i` /data/world + fi + done + fi ;; esac @@ -201,19 +212,29 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then fi fi +# Make sure files exist to avoid errors +if [ ! -e banned-players.json ]; then + echo '' > banned-players.json +fi +if [ ! -e banned-ip.json ]; then + echo '' > banned-ip.json +fi + # If any modules have been provided, copy them over [ -d /data/mods ] || mkdir /data/mods for m in /mods/*.jar do if [ -f "$m" ]; then - cp $m /data/mods + echo Copying mod `basename $m` + cp -f $m /data/mods fi done [ -d /data/config ] || mkdir /data/config for c in /config/* do if [ -f "$c" ]; then - cp -r $c /data/config + echo Copying configuration `basename $m` + cp -rf $c /data/config fi done