mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 15:36:22 +00:00
Compare commits
108 Commits
2021.21.0-
...
2021.22.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6124bdd01 | ||
|
|
9544aeaf7a | ||
|
|
babeac1693 | ||
|
|
9f0edde0b3 | ||
|
|
130b067955 | ||
|
|
1d97fccfdf | ||
|
|
df7d6c298a | ||
|
|
5ad85de964 | ||
|
|
a8a60264e9 | ||
|
|
721df8d32b | ||
|
|
2375a6796c | ||
|
|
e04e943e1c | ||
|
|
1bf75671f6 | ||
|
|
7d56de9d15 | ||
|
|
c273e99007 | ||
|
|
a8de790b57 | ||
|
|
cafddd3b12 | ||
|
|
fc958faf7b | ||
|
|
402894cd8d | ||
|
|
f97cea4b06 | ||
|
|
72ea47148a | ||
|
|
25782fc63e | ||
|
|
283b5ba431 | ||
|
|
5933fffcca | ||
|
|
de5b7cb601 | ||
|
|
c836e29ac3 | ||
|
|
d9214f0204 | ||
|
|
a7efcfff49 | ||
|
|
618d6236ba | ||
|
|
929eeeedfc | ||
|
|
6494ca8864 | ||
|
|
d964231906 | ||
|
|
1d8c28e024 | ||
|
|
d63c570cf3 | ||
|
|
f7f1855e24 | ||
|
|
8ccf0201a8 | ||
|
|
fa9e59edd8 | ||
|
|
25a2ab6ff3 | ||
|
|
bb780c000d | ||
|
|
cb4691a9ac | ||
|
|
76b8b89295 | ||
|
|
551e4d6346 | ||
|
|
61a660ee48 | ||
|
|
5e9806736c | ||
|
|
d5865cd60c | ||
|
|
2b0b8f8a62 | ||
|
|
e94b40bddf | ||
|
|
2dabf34349 | ||
|
|
eb864c0fb8 | ||
|
|
2e0f469748 | ||
|
|
aa95dc291b | ||
|
|
d22280fae7 | ||
|
|
aac3c1c77a | ||
|
|
61b0eff4ca | ||
|
|
8c5f0a53bf | ||
|
|
fffeb7bb9c | ||
|
|
a060cc88d1 | ||
|
|
4421aaa22d | ||
|
|
3a51db6d24 | ||
|
|
969a23ae27 | ||
|
|
1a62592fe2 | ||
|
|
c316dbb5d2 | ||
|
|
bb64135c9b | ||
|
|
ef98de154c | ||
|
|
3d00077ef8 | ||
|
|
0d3ab75683 | ||
|
|
87681e64bb | ||
|
|
8ce986d3d7 | ||
|
|
67fda61de4 | ||
|
|
7c6ec41822 | ||
|
|
93af2025a2 | ||
|
|
c1b040af77 | ||
|
|
4148325787 | ||
|
|
7083cd15e8 | ||
|
|
7418dab476 | ||
|
|
94bbc8e649 | ||
|
|
3e5e62229a | ||
|
|
fe2a9d56ed | ||
|
|
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 |
10
.github/ISSUE_TEMPLATE/bug.yml
vendored
10
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -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
|
||||||
|
```
|
||||||
7
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
7
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -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
|
||||||
2
.github/workflows/build-multiarch.yml
vendored
2
.github/workflows/build-multiarch.yml
vendored
@@ -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
|
||||||
|
|||||||
2
.github/workflows/generate-toc.yml
vendored
2
.github/workflows/generate-toc.yml
vendored
@@ -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
|
||||||
|
|||||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -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
|
||||||
|
|||||||
2
.github/workflows/pr.yml
vendored
2
.github/workflows/pr.yml
vendored
@@ -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,4 +1,4 @@
|
|||||||
FROM eclipse-temurin:17-jdk
|
FROM eclipse-temurin:8-jdk
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 setServerPropValue {
|
||||||
|
local prop=$1
|
||||||
|
local value=$2
|
||||||
|
# normalize booleans
|
||||||
|
case ${value^^} in
|
||||||
|
TRUE|FALSE)
|
||||||
|
value=${value,,} ;;
|
||||||
|
esac
|
||||||
|
if grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
||||||
|
log "Setting ${prop} to '${value}' in ${SERVER_PROPERTIES}"
|
||||||
|
sed -i "/^${prop}\s*=/ c ${prop}=${value//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||||
|
else
|
||||||
|
log "Adding ${prop} with '${value}' in ${SERVER_PROPERTIES}"
|
||||||
|
echo "${prop}=${value}" >> "$SERVER_PROPERTIES"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function setServerProp {
|
function setServerProp {
|
||||||
local prop=$1
|
local prop=$1
|
||||||
local var=$2
|
local varName=$2
|
||||||
if [ -n "$var" ]; then
|
|
||||||
# normalize booleans
|
if [ -v $varName ]; then
|
||||||
case ${var^^} in
|
setServerPropValue "$prop" "${!varName}"
|
||||||
TRUE|FALSE)
|
|
||||||
var=${var,,} ;;
|
|
||||||
esac
|
|
||||||
if grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
|
||||||
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
|
||||||
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
|
||||||
else
|
|
||||||
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
|
|
||||||
echo "${prop}=${var}" >> "$SERVER_PROPERTIES"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
isDebugging && log "Skip setting ${prop}"
|
|
||||||
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