Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ENV RENDER_POI "true"
ENV RENDER_SIGNS_FILTER "-- RENDER --"
ENV RENDER_SIGNS_HIDE_FILTER "false"
ENV RENDER_SIGNS_JOINER "<br />"
ENV REFRESH_DURATION 0

# ---------------------------- #
# INSTALL & CONFIGURE DEFAULTS #
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ _Note:_ The `latest` Docker tag is rebuilt daily. If there are changes to the [u

- `RENDER_SIGNS_JOINER`
Default Value: `<br />`. Set to the string that should be used to join the lines on the sign while rendering. Value of `"<br />"` will make each in-game line it's own line on the render. A value of `" "` will make all the in-game lines a single line on the render.
- `REFRESH_DURATION`
Default Value: `0`. Set to a number to regenerate the map every `REFRESH_DURATION` seconds. Disabled if set to `0`.
38 changes: 25 additions & 13 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
#!/bin/bash
set -o errexit

render_map() {
# Render the Map
if [ "$RENDER_MAP" == "true" ]; then
# (We disable to support passing multiple arguments)
# shellcheck disable=SC2086
overviewer.py --config "$CONFIG_LOCATION" $ADDITIONAL_ARGS
fi

# Render the POI
if [ "$RENDER_POI" == "true" ]; then
# (We disable to support passing multiple arguments)
# shellcheck disable=SC2086
overviewer.py --config "$CONFIG_LOCATION" --genpoi $ADDITIONAL_ARGS_POI
fi
}

# Require MINECRAFT_VERSION environment variable to be set (no default assumed)
if [ -z "$MINECRAFT_VERSION" ]; then
echo "Expecting environment variable MINECRAFT_VERSION to be set to non-empty string. Exiting."
Expand Down Expand Up @@ -30,16 +46,12 @@ else
echo "Download complete."
fi

# Render the Map
if [ "$RENDER_MAP" == "true" ]; then
# (We disable to support passing multiple arguments)
# shellcheck disable=SC2086
overviewer.py --config "$CONFIG_LOCATION" $ADDITIONAL_ARGS
fi

# Render the POI
if [ "$RENDER_POI" == "true" ]; then
# (We disable to support passing multiple arguments)
# shellcheck disable=SC2086
overviewer.py --config "$CONFIG_LOCATION" --genpoi $ADDITIONAL_ARGS_POI
fi
# Render the map, either once if REFRESH_DURATION is 0, or every REFRESH_DURATION seconds
if [ $REFRESH_DURATION -gt 0 ]; then
while true; do
render_map
sleep $REFRESH_DURATION
done
else
render_map
fi