mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-07 09:05:09 +00:00
Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf9c40f331 | |||
| 9544aeaf7a | |||
| babeac1693 | |||
| 491ffe49bf | |||
| 130b067955 | |||
| d4a9b367c7 | |||
| df7d6c298a | |||
| 032d94a30f | |||
| a8a60264e9 | |||
| 721df8d32b | |||
| 2375a6796c | |||
| e04e943e1c | |||
| 1bf75671f6 | |||
| 7d56de9d15 | |||
| 3784d2df54 | |||
| a8de790b57 | |||
| cafddd3b12 | |||
| fc958faf7b | |||
| 402894cd8d | |||
| f97cea4b06 | |||
| 8a36823843 | |||
| 78c520572a | |||
| 5303105265 | |||
| 1f120c5fa4 | |||
| 70ec3b838d | |||
| b248ed342f | |||
| 4c70184804 | |||
| b9ba062add | |||
| cbb1d0ea52 | |||
| bbad3a3e7a | |||
| 8965397a5a | |||
| c661fe7318 | |||
| bae1feb750 | |||
| edbcf80a70 | |||
| fb23e12680 | |||
| e30a2e6448 | |||
| 03d7babd68 | |||
| 332b929a6d | |||
| c138cabc65 | |||
| 41631e35e8 | |||
| 6f95fa6175 | |||
| 6f16da8309 | |||
| 8cee8d5618 | |||
| 8b76b5776a | |||
| e3af06d2e4 | |||
| 0ac583514c | |||
| bf3f15f5fb | |||
| 4aec2322b5 | |||
| 51b2eb6851 | |||
| 846050f41a | |||
| 485ec6a141 | |||
| 0096e41882 | |||
| d45610723a | |||
| 072704b54d | |||
| 0f08e88c5b | |||
| 89604c8d13 | |||
| 58842d444b | |||
| 457d09e14d | |||
| 7210e81f47 | |||
| ba86534e6e | |||
| 44bafbff09 | |||
| 75c51bf0c7 | |||
| cf651f2279 | |||
| 6d0d7fe19c | |||
| bb58d7a4c9 | |||
| 6efaac2861 | |||
| 806342d74b | |||
| 926e302595 | |||
| 10e85140ad | |||
| fc2ed9e612 | |||
| edfe58079a | |||
| d423cc3b8d | |||
| 1537e48e29 | |||
| 62473771dc | |||
| c4528e8f79 | |||
| 0f797487ab | |||
| 9511e3cc80 | |||
| 3aa4dd6c85 | |||
| 27571999b2 | |||
| bbd7d9e39a | |||
| ef6f308229 | |||
| 49d89d3e73 | |||
| 74203b23f4 | |||
| 4fb791b490 | |||
| ced25ad50a | |||
| 48efc224ba | |||
| 467c1d9954 | |||
| 9ced230f55 | |||
| f3a8276362 | |||
| b91d63716e | |||
| 46cccfd531 | |||
| 9fe1cb4a0d | |||
| 076038b470 | |||
| aa416729ea | |||
| 812c6365ec | |||
| 42a5131b19 | |||
| 624f6a210f | |||
| 1c63cd18b7 | |||
| 6266a7e3cc | |||
| 871ecd4d9d | |||
| c572c95161 | |||
| f7b58fbbb1 | |||
| eccfa444a9 | |||
| e831d25706 | |||
| 12e931332b | |||
| ceee9eddc9 | |||
| 60ba668743 | |||
| fd1b15e01f |
@@ -24,9 +24,17 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Container definition
|
label: Container definition
|
||||||
description: Please provide the compose file or run command used to create the container
|
description: Please provide the compose file or run command used to create the container
|
||||||
|
value: |
|
||||||
|
```
|
||||||
|
Paste run command or compose file here
|
||||||
|
```
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: logs
|
id: logs
|
||||||
attributes:
|
attributes:
|
||||||
label: Container logs
|
label: Container logs
|
||||||
description: |
|
description: |
|
||||||
Please provide container logs from the start of the container, which will be the ones prefixed with `[init]`. It is even better if you can set the variable `DEBUG` to "true" and provide those debug container logs.
|
Please provide container logs from the start of the container, which will be the ones prefixed with `[init]`. It is even better if you can set the variable `DEBUG` to "true" and provide those debug container logs.
|
||||||
|
value: |
|
||||||
|
```
|
||||||
|
Paste logs here
|
||||||
|
```
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
contact_links:
|
||||||
|
- name: Ask a question in discussions
|
||||||
|
url: https://github.com/itzg/docker-minecraft-server/discussions
|
||||||
|
about: Please ask questions here
|
||||||
|
- name: Ask a question on Discord
|
||||||
|
url: https://discord.gg/DXfKpjB
|
||||||
|
about: Please ask questions here
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.5
|
uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.7.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
# ensure latest base image is used
|
# ensure latest base image is used
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
- run: |
|
- run: |
|
||||||
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
|
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
|
||||||
chmod a+x gh-md-toc
|
chmod a+x gh-md-toc
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.5
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+1
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM eclipse-temurin:17-jdk
|
FROM adoptopenjdk:8-jdk-openj9
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
@@ -75,7 +75,6 @@ ENV UID=1000 GID=1000 \
|
|||||||
MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST \
|
TYPE=VANILLA VERSION=LATEST \
|
||||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
|
||||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||||
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
|
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
* [Contributing](#contributing)
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Fri Nov 5 02:00:06 UTC 2021 -->
|
<!-- Added by: runner, at: Tue Nov 16 02:46:53 UTC 2021 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
@@ -567,8 +567,6 @@ docker run -d -v /path/on/host:/data ... \
|
|||||||
-e FABRIC_LOADER_VERSION=0.11.7
|
-e FABRIC_LOADER_VERSION=0.11.7
|
||||||
```
|
```
|
||||||
|
|
||||||
In order to add mods, you have two options:
|
|
||||||
|
|
||||||
### Running a Limbo server
|
### Running a Limbo server
|
||||||
|
|
||||||
A [Limbo](https://github.com/LOOHP/Limbo) server can be run by setting `TYPE` to `LIMBO`.
|
A [Limbo](https://github.com/LOOHP/Limbo) server can be run by setting `TYPE` to `LIMBO`.
|
||||||
@@ -808,6 +806,8 @@ This will reset any manual configuration of the `server.properties` file, so if
|
|||||||
|
|
||||||
In the opposite case, you can skip the startup script's creation of `server.properties`, by setting `SKIP_SERVER_PROPERTIES` to "true".
|
In the opposite case, you can skip the startup script's creation of `server.properties`, by setting `SKIP_SERVER_PROPERTIES` to "true".
|
||||||
|
|
||||||
|
> NOTE: to clear a server property, set the variable to an empty string, such as `-e RESOURCE_PACK=""`. A variables that maps to a server property that is unset, is ignored and the existing `server.property` is left unchanged.
|
||||||
|
|
||||||
### Message of the Day
|
### Message of the Day
|
||||||
|
|
||||||
The message of the day, shown below each server entry in the client UI, can be changed with the `MOTD` environment variable, such as
|
The message of the day, shown below each server entry in the client UI, can be changed with the `MOTD` environment variable, such as
|
||||||
@@ -875,6 +875,7 @@ The server icon which has been set doesn't get overridden by default. It can be
|
|||||||
### Rcon
|
### Rcon
|
||||||
|
|
||||||
To use rcon use the `ENABLE_RCON` and `RCON_PASSWORD` variables.
|
To use rcon use the `ENABLE_RCON` and `RCON_PASSWORD` variables.
|
||||||
|
The default RCON password is _"minecraft",_ but it's **highly** recommended to override that.
|
||||||
By default rcon port will be `25575` but can easily be changed with the `RCON_PORT` variable.
|
By default rcon port will be `25575` but can easily be changed with the `RCON_PORT` variable.
|
||||||
|
|
||||||
docker run -d -e ENABLE_RCON=true -e RCON_PASSWORD=testing
|
docker run -d -e ENABLE_RCON=true -e RCON_PASSWORD=testing
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# shellcheck source=../start-utils
|
# shellcheck source=../scripts/start-utils
|
||||||
. ${SCRIPTS:-/}start-utils
|
. "${SCRIPTS:-/}start-utils"
|
||||||
|
|
||||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||||
echo "Healthcheck disabled"
|
echo "Healthcheck disabled"
|
||||||
@@ -10,6 +10,6 @@ elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' |
|
|||||||
echo "Java process suspended by Autopause function"
|
echo "Java process suspended by Autopause function"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
mc-monitor status --host localhost --port $SERVER_PORT
|
mc-monitor status --host localhost --port "${SERVER_PORT:-25565}"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
<Console name="SysOut" target="SYSTEM_OUT">
|
<Console name="SysOut" target="SYSTEM_OUT">
|
||||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||||
</Console>
|
</Console>
|
||||||
<Queue name="ServerGuiConsole">
|
<Queue name="TerminalConsole">
|
||||||
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
||||||
</Queue>
|
</Queue>
|
||||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</filters>
|
</filters>
|
||||||
<AppenderRef ref="SysOut"/>
|
<AppenderRef ref="SysOut"/>
|
||||||
<AppenderRef ref="File"/>
|
<AppenderRef ref="File"/>
|
||||||
<AppenderRef ref="ServerGuiConsole"/>
|
<AppenderRef ref="TerminalConsole"/>
|
||||||
</Root>
|
</Root>
|
||||||
</Loggers>
|
</Loggers>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
|
|
||||||
|
: "${SERVER_PORT:=25565}"
|
||||||
|
export SERVER_PORT
|
||||||
|
|
||||||
log "Autopause functionality enabled"
|
log "Autopause functionality enabled"
|
||||||
|
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
|
cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg
|
||||||
|
|
||||||
# update server port to listen to
|
# update server port to listen to
|
||||||
|
|||||||
@@ -103,14 +103,6 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FORGE)
|
FORGE)
|
||||||
if versionLessThan 1.17; then
|
|
||||||
log "**********************************************************************"
|
|
||||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
|
||||||
log " since some mods require Java 8"
|
|
||||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
|
||||||
log " can be fixed with java8"
|
|
||||||
log "**********************************************************************"
|
|
||||||
fi
|
|
||||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -123,10 +115,6 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
FTB|CURSEFORGE)
|
||||||
log "**********************************************************************"
|
|
||||||
log "NOTE: Some mods and modpacks may require Java 8."
|
|
||||||
log " If so, use itzg/minecraft-server:java8"
|
|
||||||
log "**********************************************************************"
|
|
||||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -171,12 +159,6 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
CRUCIBLE)
|
CRUCIBLE)
|
||||||
log "**********************************************************************"
|
|
||||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
|
||||||
log " since some mods require Java 8"
|
|
||||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
|
||||||
log " can be fixed with java8"
|
|
||||||
log "**********************************************************************"
|
|
||||||
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
|
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,16 @@ if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if versionLessThan 1.6; then
|
||||||
|
if ! [[ -L /data/minecraft_server.jar && /data/minecraft_server.jar -ef "/data/$SERVER" ]]; then
|
||||||
|
rm -f /data/minecraft_server.jar
|
||||||
|
ln -s "/data/$SERVER" /data/minecraft_server.jar
|
||||||
|
fi
|
||||||
|
SERVER=minecraft_server.jar
|
||||||
|
elif [[ -L /data/minecraft_server.jar ]]; then
|
||||||
|
rm -f /data/minecraft_server.jar
|
||||||
|
fi
|
||||||
|
|
||||||
isDebugging && ls -l
|
isDebugging && ls -l
|
||||||
|
|
||||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||||
|
|||||||
@@ -1,40 +1,46 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
|
|
||||||
: ${SERVER_PROPERTIES:=/data/server.properties}
|
: "${SERVER_PROPERTIES:=/data/server.properties}"
|
||||||
|
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
function setServerProp {
|
function setServerPropValue {
|
||||||
local prop=$1
|
local prop=$1
|
||||||
local var=$2
|
local value=$2
|
||||||
if [ -n "$var" ]; then
|
|
||||||
# normalize booleans
|
# normalize booleans
|
||||||
case ${var^^} in
|
case ${value^^} in
|
||||||
TRUE|FALSE)
|
TRUE|FALSE)
|
||||||
var=${var,,} ;;
|
value=${value,,} ;;
|
||||||
esac
|
esac
|
||||||
if grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
if grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
||||||
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
log "Setting ${prop} to '${value}' in ${SERVER_PROPERTIES}"
|
||||||
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
sed -i "/^${prop}\s*=/ c ${prop}=${value//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||||
else
|
else
|
||||||
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
|
log "Adding ${prop} with '${value}' in ${SERVER_PROPERTIES}"
|
||||||
echo "${prop}=${var}" >> "$SERVER_PROPERTIES"
|
echo "${prop}=${value}" >> "$SERVER_PROPERTIES"
|
||||||
fi
|
fi
|
||||||
else
|
}
|
||||||
isDebugging && log "Skip setting ${prop}"
|
|
||||||
|
function setServerProp {
|
||||||
|
local prop=$1
|
||||||
|
local varName=$2
|
||||||
|
|
||||||
|
if [ -v $varName ]; then
|
||||||
|
setServerPropValue "$prop" "${!varName}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function customizeServerProps {
|
function customizeServerProps {
|
||||||
if [ -n "$WHITELIST" ] || isTrue ${ENABLE_WHITELIST:-false}; then
|
if [ -n "$WHITELIST" ] || isTrue "${ENABLE_WHITELIST:-false}"; then
|
||||||
log "Creating whitelist"
|
log "Creating whitelist"
|
||||||
setServerProp "whitelist" "true"
|
setServerPropValue "whitelist" "true"
|
||||||
setServerProp "white-list" "true"
|
setServerPropValue "white-list" "true"
|
||||||
else
|
else
|
||||||
log "Disabling whitelist"
|
log "Disabling whitelist"
|
||||||
setServerProp "whitelist" "false"
|
setServerPropValue "whitelist" "false"
|
||||||
setServerProp "white-list" "false"
|
setServerPropValue "white-list" "false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If not provided, generate a reasonable default message-of-the-day,
|
# If not provided, generate a reasonable default message-of-the-day,
|
||||||
@@ -53,57 +59,57 @@ function customizeServerProps {
|
|||||||
MOTD="A ${label} Minecraft Server powered by Docker"
|
MOTD="A ${label} Minecraft Server powered by Docker"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setServerProp "server-name" "$SERVER_NAME"
|
setServerProp "server-name" SERVER_NAME
|
||||||
setServerProp "server-ip" "$SERVER_IP"
|
setServerProp "server-ip" SERVER_IP
|
||||||
setServerProp "server-port" "$SERVER_PORT"
|
setServerProp "server-port" SERVER_PORT
|
||||||
setServerProp "motd" "$(echo $MOTD | mc-image-helper asciify)"
|
setServerProp "allow-nether" ALLOW_NETHER
|
||||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
setServerProp "announce-player-achievements" ANNOUNCE_PLAYER_ACHIEVEMENTS
|
||||||
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
|
setServerProp "enable-command-block" ENABLE_COMMAND_BLOCK
|
||||||
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
|
setServerProp "spawn-animals" SPAWN_ANIMALS
|
||||||
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
setServerProp "spawn-monsters" SPAWN_MONSTERS
|
||||||
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
setServerProp "spawn-npcs" SPAWN_NPCS
|
||||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
setServerProp "spawn-protection" SPAWN_PROTECTION
|
||||||
setServerProp "spawn-protection" "$SPAWN_PROTECTION"
|
setServerProp "generate-structures" GENERATE_STRUCTURES
|
||||||
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
setServerProp "view-distance" VIEW_DISTANCE
|
||||||
setServerProp "view-distance" "$VIEW_DISTANCE"
|
setServerProp "hardcore" HARDCORE
|
||||||
setServerProp "hardcore" "$HARDCORE"
|
setServerProp "snooper-enabled" SNOOPER_ENABLED
|
||||||
setServerProp "snooper-enabled" "$SNOOPER_ENABLED"
|
setServerProp "max-build-height" MAX_BUILD_HEIGHT
|
||||||
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
|
setServerProp "force-gamemode" FORCE_GAMEMODE
|
||||||
setServerProp "force-gamemode" "$FORCE_GAMEMODE"
|
setServerProp "max-tick-time" MAX_TICK_TIME
|
||||||
setServerProp "max-tick-time" "$MAX_TICK_TIME"
|
setServerProp "enable-query" ENABLE_QUERY
|
||||||
setServerProp "enable-query" "$ENABLE_QUERY"
|
setServerProp "query.port" QUERY_PORT
|
||||||
setServerProp "query.port" "$QUERY_PORT"
|
setServerProp "enable-rcon" ENABLE_RCON
|
||||||
setServerProp "enable-rcon" "$ENABLE_RCON"
|
setServerProp "rcon.password" RCON_PASSWORD
|
||||||
setServerProp "rcon.password" "$RCON_PASSWORD"
|
setServerProp "rcon.port" RCON_PORT
|
||||||
setServerProp "rcon.port" "$RCON_PORT"
|
setServerProp "max-players" MAX_PLAYERS
|
||||||
setServerProp "max-players" "$MAX_PLAYERS"
|
setServerProp "max-world-size" MAX_WORLD_SIZE
|
||||||
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
|
setServerProp "level-name" LEVEL
|
||||||
setServerProp "level-name" "$LEVEL"
|
setServerProp "level-seed" SEED
|
||||||
setServerProp "level-seed" "$SEED"
|
setServerProp "pvp" PVP
|
||||||
setServerProp "pvp" "${PVP}"
|
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 "resource-pack" RESOURCE_PACK
|
||||||
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
setServerProp "resource-pack-sha1" RESOURCE_PACK_SHA1
|
||||||
setServerProp "resource-pack" "$RESOURCE_PACK"
|
setServerProp "player-idle-timeout" PLAYER_IDLE_TIMEOUT
|
||||||
setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1"
|
setServerProp "broadcast-console-to-ops" BROADCAST_CONSOLE_TO_OPS
|
||||||
setServerProp "player-idle-timeout" "$PLAYER_IDLE_TIMEOUT"
|
setServerProp "broadcast-rcon-to-ops" BROADCAST_RCON_TO_OPS
|
||||||
setServerProp "broadcast-console-to-ops" "$BROADCAST_CONSOLE_TO_OPS"
|
setServerProp "enable-jmx-monitoring" ENABLE_JMX
|
||||||
setServerProp "broadcast-rcon-to-ops" "$BROADCAST_RCON_TO_OPS"
|
setServerProp "sync-chunk-writes" SYNC_CHUNK_WRITES
|
||||||
setServerProp "enable-jmx-monitoring" "$ENABLE_JMX"
|
setServerProp "enable-status" ENABLE_STATUS
|
||||||
setServerProp "sync-chunk-writes" "$SYNC_CHUNK_WRITES"
|
setServerProp "entity-broadcast-range-percentage" ENTITY_BROADCAST_RANGE_PERCENTAGE
|
||||||
setServerProp "enable-status" "$ENABLE_STATUS"
|
setServerProp "function-permission-level" FUNCTION_PERMISSION_LEVEL
|
||||||
setServerProp "entity-broadcast-range-percentage" "$ENTITY_BROADCAST_RANGE_PERCENTAGE"
|
setServerProp "network-compression-threshold" NETWORK_COMPRESSION_THRESHOLD
|
||||||
setServerProp "function-permission-level" "$FUNCTION_PERMISSION_LEVEL"
|
setServerProp "op-permission-level" OP_PERMISSION_LEVEL
|
||||||
setServerProp "network-compression-threshold" "$NETWORK_COMPRESSION_THRESHOLD"
|
setServerProp "prevent-proxy-connections" PREVENT_PROXY_CONNECTIONS
|
||||||
setServerProp "op-permission-level" "$OP_PERMISSION_LEVEL"
|
setServerProp "use-native-transport" USE_NATIVE_TRANSPORT
|
||||||
setServerProp "prevent-proxy-connections" "$PREVENT_PROXY_CONNECTIONS"
|
setServerProp "enforce-whitelist" ENFORCE_WHITELIST
|
||||||
setServerProp "use-native-transport" "$USE_NATIVE_TRANSPORT"
|
setServerProp "simulation-distance" SIMULATION_DISTANCE
|
||||||
setServerProp "enforce-whitelist" "$ENFORCE_WHITELIST"
|
setServerPropValue "motd" "$(echo "$MOTD" | mc-image-helper asciify)"
|
||||||
setServerProp "simulation-distance" "$SIMULATION_DISTANCE"
|
[[ $LEVEL_TYPE ]] && setServerPropValue "level-type" "${LEVEL_TYPE^^}"
|
||||||
|
|
||||||
if [ -n "$DIFFICULTY" ]; then
|
if [ -n "$DIFFICULTY" ]; then
|
||||||
case $DIFFICULTY in
|
case ${DIFFICULTY,,} in
|
||||||
peaceful|0)
|
peaceful|0)
|
||||||
if versionLessThan 1.13; then
|
if versionLessThan 1.13; then
|
||||||
DIFFICULTY=0
|
DIFFICULTY=0
|
||||||
@@ -137,13 +143,12 @@ function customizeServerProps {
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
setServerProp "difficulty" "$DIFFICULTY"
|
setServerPropValue "difficulty" "$DIFFICULTY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$MODE" ]; then
|
if [ -n "$MODE" ]; then
|
||||||
log "Setting mode"
|
log "Setting mode"
|
||||||
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
|
case ${MODE,,} in
|
||||||
case $MODE_LC in
|
|
||||||
su*|0)
|
su*|0)
|
||||||
if versionLessThan 1.13; then
|
if versionLessThan 1.13; then
|
||||||
MODE=0
|
MODE=0
|
||||||
@@ -177,7 +182,7 @@ function customizeServerProps {
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
setServerProp "gamemode" "$MODE"
|
setServerPropValue "gamemode" "$MODE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,16 +215,16 @@ fi
|
|||||||
|
|
||||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||||
current_max_tick=$( grep 'max-tick-time' "$SERVER_PROPERTIES" | sed -r 's/( )+//g' | awk -F= '{print $2}' )
|
current_max_tick=$( grep 'max-tick-time' "$SERVER_PROPERTIES" | sed -r 's/( )+//g' | awk -F= '{print $2}' )
|
||||||
if (( $current_max_tick > 0 && $current_max_tick < 86400000 )); then
|
if (( current_max_tick > 0 && current_max_tick < 86400000 )); then
|
||||||
log "Warning: The server.properties for the server doesn't have the Server Watchdog (effectively) disabled."
|
log "Warning: The server.properties for the server doesn't have the Server Watchdog (effectively) disabled."
|
||||||
log "Warning (cont): Autopause functionality resuming the process might trigger the Watchdog and restart the server completely."
|
log "Warning (cont): Autopause functionality resuming the process might trigger the Watchdog and restart the server completely."
|
||||||
log "Warning (cont): Set the max-tick-time property to a high value (or disable the Watchdog with value -1 for versions 1.8.1+)."
|
log "Warning (cont): Set the max-tick-time property to a high value (or disable the Watchdog with value -1 for versions 1.8.1+)."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if isDebugging; then
|
if isDebugging && [ -f "${SERVER_PROPERTIES}" ]; then
|
||||||
log "DEBUG Dumping server.properties"
|
log "DEBUG Dumping server.properties"
|
||||||
cat "${SERVER_PROPERTIES}"
|
cat "${SERVER_PROPERTIES}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-setupEnvVariables $@
|
exec "${SCRIPTS:-/}start-setupEnvVariables" "$@"
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
set -e
|
set -e
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
: ${LEVEL:=world}
|
|
||||||
export LEVEL
|
|
||||||
|
|
||||||
if [ $TYPE = "CURSEFORGE" ]; then
|
if [ $TYPE = "CURSEFORGE" ]; then
|
||||||
worldDest=$FTB_DIR/$LEVEL
|
worldDest=$FTB_DIR/${LEVEL:-world}
|
||||||
else
|
else
|
||||||
worldDest=/data/$LEVEL
|
worldDest=/data/${LEVEL:-world}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
||||||
@@ -71,4 +69,4 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-setupModpack $@
|
exec "${SCRIPTS:-/}start-setupModpack" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user