From 10b832bdb2e39f8ab76e7dba8772e311c411a1ca Mon Sep 17 00:00:00 2001 From: saibotk Date: Thu, 9 Jul 2020 22:52:12 +0200 Subject: [PATCH] Update to version 2.1.0 --- .gitignore | 2 ++ Dockerfile | 33 ++++++-------------------- README.md | 13 ++++------- files/config.json | 36 +++++++++++++++++++++++++++++ files/docker-entrypoint.sh | 47 +++----------------------------------- 5 files changed, 53 insertions(+), 78 deletions(-) create mode 100644 .gitignore create mode 100644 files/config.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d727b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +output/ diff --git a/Dockerfile b/Dockerfile index 7fabce5..cca31d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,14 @@ -FROM openjdk:13-alpine +FROM docker.io/library/openjdk:14-alpine -MAINTAINER https://github.com/saibotk/BlockMap-Docker +ENV VERSION=2.1.0 \ + SHA1=47de080154f4562dc1601d23b58a12e790ec9fa5 -ARG USER=blockmap -ARG GROUP=blockmap -ARG PUID=844 -ARG PGID=844 - -ENV OUTPUT=/blockmap/output \ - INPUT_OVERWORLD=/blockmap/input/overworld \ - INPUT_NETHER=/blockmap/input/nether/ \ - INPUT_END=/blockmap/input/end/ \ - VERSION=1.4.0 \ - SHA1=6b51f4d3d23094da2820d9461036a618c2933083 - -RUN mkdir -p /opt/blockmap /blockmap && \ +RUN mkdir -p /opt/blockmap /input /output && \ apk add --update --no-cache su-exec binutils gettext libintl && \ apk add --update --no-cache --virtual .build-deps curl && \ - curl -sSL https://github.com/Minecraft-Technik-Wiki/BlockMap/releases/download/$VERSION/BlockMap-$VERSION.jar -o /opt/blockmap/BlockMap.jar && \ - echo "$SHA1 /opt/blockmap/BlockMap.jar" | sha1sum -c && \ - chmod ugo=rwx /opt/blockmap && \ - ln -s $INPUT_OVERWORLD /opt/blockmap/overworld && \ - ln -s $INPUT_NETHER /opt/blockmap/nether && \ - ln -s $INPUT_END /opt/blockmap/end && \ - ln -s $OUTPUT /opt/blockmap/output && \ - apk del .build-deps curl && \ - addgroup -g $PGID -S $GROUP && \ - adduser -u $PUID -G $GROUP -s /bin/sh -SDH $USER && \ - chown -R $USER:$GROUP /opt/blockmap /blockmap + curl -sSL https://github.com/Minecraft-Technik-Wiki/BlockMap/releases/download/$VERSION/BlockMap-cli-$VERSION.jar -o /opt/blockmap/blockmap.jar && \ + echo "$SHA1 /opt/blockmap/blockmap.jar" | sha1sum -c && \ + apk del .build-deps curl COPY files/ / diff --git a/README.md b/README.md index cf53408..86587fb 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,12 @@ This image can be used to render a Minecraft map, by just mounting the world fol *They should all point to a directory, where the region files are located (files like **r.0.0.mca**) or if you want all data to be processed, the parent folder (usually where the 'region') folder lives in.* ``` -sudo docker run -d \ - -v /MY-MINECRAFT-PATH/world/:/blockmap/input/overworld/ \ - -v /MY-MINECRAFT-PATH/world_nether/:/blockmap/input/nether/ \ - -v /MY-MINECRAFT-PATH/world_the_end/:/blockmap/input/end/ \ - -v /MY-OUTPUT-PATH/output:/opt/blockmap/output \ +sudo docker run \ + -v /MY-MINECRAFT-PATH/world:/input \ + -v /MY-OUTPUT-PATH/output:/output \ --name blockmap \ saibotk/blockmap ``` -### BlockMap + Nginx setup - -*Coming soon...* \ No newline at end of file +### Customization +Coming soon \ No newline at end of file diff --git a/files/config.json b/files/config.json new file mode 100644 index 0000000..e4a83f2 --- /dev/null +++ b/files/config.json @@ -0,0 +1,36 @@ +{ + "output dir": "/output", + "hide offline players": false, + "worlds": [ + { + "name": "Overworld", + "input dir": "/input", + "dimension": "OVERWORLD", + "force": false, + "pins": true + }, + { + "name": "Oceans", + "input dir": "/input", + "dimension": "OVERWORLD", + "force": false, + "pins": true, + "render settings": { + "block colors": "OCEAN_GROUND", + "shader": "RELIEF" + } + }, + { + "name": "Nether", + "input dir": "/input", + "dimension": "NETHER", + "render settings": { + "block colors": "X_RAY", + "shader": "FLAT", + "maxY": "80" + }, + "force": false, + "pins": true + } + ] +} \ No newline at end of file diff --git a/files/docker-entrypoint.sh b/files/docker-entrypoint.sh index be524f7..ae98180 100755 --- a/files/docker-entrypoint.sh +++ b/files/docker-entrypoint.sh @@ -1,50 +1,9 @@ -#!/bin/sh +x +#!/bin/sh # Stop this script on the first failure (e.g. cannot create the output folder) set -e -# This script renders one or more worlds with different settings. It is an example for how to use BlockMap in scripts. Adapt these -# variables to point to the required data for -# this to work. Further below are the actual render commands. Feel free to adapt them to your needs. -# -# The current configuration will render each dimension at least once, the overworld even multiple times (ocean ground view and -# cave view). All images are written to a different -# subfolder for each setting. +echo "[INFO] Start rendering..." -WORLD_FOLDER_OVERWORLD=/opt/blockmap/overworld -WORLD_FOLDER_NETHER=/opt/blockmap/nether -WORLD_FOLDER_END=/opt/blockmap/end -OUTPUT_DIR=/opt/blockmap/output -BLOCKMAP_FILE=/opt/blockmap/BlockMap.jar - -ls -l /opt/blockmap -# A simple and plain overworld view -echo "[INFO] Rendering overworld..." -mkdir -p $OUTPUT_DIR/overworld -java -jar $BLOCKMAP_FILE -v render -l -o=$OUTPUT_DIR/overworld $WORLD_FOLDER_OVERWORLD - -# The ocean grounds of the overworld -echo "[INFO] Rendering overworld_ocean..." -mkdir -p $OUTPUT_DIR/overworld_ocean -java -jar $BLOCKMAP_FILE -v render -l -o=$OUTPUT_DIR/overworld_ocean -c=OCEAN_GROUND $WORLD_FOLDER_OVERWORLD - -# The nether up to height 64 -echo "[INFO] Rendering overworld_nether..." -mkdir -p $OUTPUT_DIR/nether -java -jar $BLOCKMAP_FILE -v render -l -o=$OUTPUT_DIR/nether --max-height=64 $WORLD_FOLDER_NETHER - -# A plain view of the end -echo "[INFO] Rendering overworld_end..." -mkdir -p $OUTPUT_DIR/end -java -jar $BLOCKMAP_FILE -v render -l -o=$OUTPUT_DIR/end $WORLD_FOLDER_END - -# Write an index file to the root directory. It is a simple name=path properties file, but in JSON. -cat << EOF > $OUTPUT_DIR/index.json -{ - "Overworld": "./overworld/rendered.json.gz", - "Overworld (Ocean)": "./overworld_ocean/rendered.json.gz", - "Nether": "./nether/rendered.json.gz", - "End": "./end/rendered.json.gz" -} -EOF +java -jar /opt/blockmap/blockmap.jar render-many /config.json echo "[INFO] Rendering finished!"