mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 15:36:22 +00:00
Compare commits
25 Commits
2021.26.0-
...
2021.25.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a31ce757d | ||
|
|
be2ef20fc1 | ||
|
|
6020400d3b | ||
|
|
ae96adaeec | ||
|
|
d34be9f20e | ||
|
|
64a02d28bc | ||
|
|
c446cb11da | ||
|
|
7aea5b593e | ||
|
|
91adfaa1d9 | ||
|
|
e7b223f1c6 | ||
|
|
45eff98011 | ||
|
|
b4111f0428 | ||
|
|
288bdf3804 | ||
|
|
5bc1ac672e | ||
|
|
a503ad2ec2 | ||
|
|
3042aa4909 | ||
|
|
8882ae5f89 | ||
|
|
4149db7f11 | ||
|
|
666f538ad5 | ||
|
|
145403ea54 | ||
|
|
5392801ecd | ||
|
|
3dfd70d068 | ||
|
|
e5bc9b939f | ||
|
|
1b620d2d6d | ||
|
|
28d77853cb |
2
.github/workflows/stale-check.yml
vendored
2
.github/workflows/stale-check.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Process Stale Issues
|
- name: Process Stale Issues
|
||||||
uses: actions/stale@v4.1.0
|
uses: actions/stale@v4.0.0
|
||||||
with:
|
with:
|
||||||
stale-issue-label: status/stale
|
stale-issue-label: status/stale
|
||||||
stale-pr-label: status/stale
|
stale-pr-label: status/stale
|
||||||
|
|||||||
41
Dockerfile
41
Dockerfile
@@ -1,29 +1,30 @@
|
|||||||
FROM openjdk:8-jdk-alpine
|
FROM eclipse-temurin:17-jdk
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
RUN apk add --no-cache -U \
|
RUN apt-get update \
|
||||||
openssl \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
|
apt-get install -y \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
lsof \
|
gosu \
|
||||||
su-exec \
|
sudo \
|
||||||
shadow \
|
net-tools \
|
||||||
bash \
|
iputils-ping \
|
||||||
curl iputils wget \
|
curl wget \
|
||||||
git \
|
git \
|
||||||
jq \
|
jq \
|
||||||
|
dos2unix \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
tzdata \
|
tzdata \
|
||||||
rsync \
|
rsync \
|
||||||
nano \
|
nano \
|
||||||
sudo \
|
unzip \
|
||||||
knock \
|
knockd \
|
||||||
ttf-dejavu
|
ttf-dejavu \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
RUN addgroup -g 1000 minecraft \
|
RUN addgroup --gid 1000 minecraft \
|
||||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||||
&& mkdir -m 777 /data \
|
|
||||||
&& chown minecraft:minecraft /data /home/minecraft
|
|
||||||
|
|
||||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -31,9 +32,9 @@ EXPOSE 25565 25575
|
|||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||||
ARG TARGETOS=linux
|
ARG TARGETOS
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT=""
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
ARG EASY_ADD_VER=0.7.1
|
ARG EASY_ADD_VER=0.7.1
|
||||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||||
@@ -59,7 +60,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.11.0
|
ARG MC_HELPER_VERSION=1.10.0
|
||||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
|
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
|
||||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||||
| tar -C /usr/share -zxf - \
|
| tar -C /usr/share -zxf - \
|
||||||
@@ -71,7 +72,7 @@ WORKDIR /data
|
|||||||
STOPSIGNAL SIGTERM
|
STOPSIGNAL SIGTERM
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" 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 \
|
||||||
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 \
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -134,7 +134,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: Tue Dec 14 02:14:33 UTC 2021 -->
|
<!-- Added by: runner, at: Sat Dec 11 22:09:10 UTC 2021 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
@@ -452,13 +452,19 @@ Plugins can either be managed within the `plugins` subdirectory of the [data dir
|
|||||||
|
|
||||||
Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line.
|
Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line.
|
||||||
|
|
||||||
By default, the container will run the latest build of [Paper server](https://papermc.io/downloads) but you can also choose to run a specific build with `-e PAPERBUILD=205`.
|
By default the container will run the latest build of [Paper server](https://papermc.io/downloads)
|
||||||
|
but you can also choose to run a specific build with `-e PAPERBUILD=205`.
|
||||||
|
|
||||||
docker run -d -v /path/on/host:/data \
|
docker run -d -v /path/on/host:/data \
|
||||||
-e TYPE=PAPER \
|
-e TYPE=PAPER \
|
||||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
|
|
||||||
If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=<url>`.
|
If you are hosting your own copy of Paper you can override the download URL with:
|
||||||
|
|
||||||
|
- -e PAPER_DOWNLOAD_URL=<url>
|
||||||
|
|
||||||
|
An example compose file is provided at
|
||||||
|
[examples/docker-compose-paper.yml](examples/docker-compose-paper.yml).
|
||||||
|
|
||||||
If you have attached a host directory to the `/data` volume, then you can install plugins via the `plugins` subdirectory. You can also [attach a `/plugins` volume](#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.
|
If you have attached a host directory to the `/data` volume, then you can install plugins via the `plugins` subdirectory. You can also [attach a `/plugins` volume](#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.
|
||||||
|
|
||||||
@@ -470,7 +476,7 @@ An [Airplane](https://airplane.gg) server, which is "a stable, optimized, well s
|
|||||||
|
|
||||||
-e TYPE=AIRPLANE
|
-e TYPE=AIRPLANE
|
||||||
|
|
||||||
> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.17" and "PURPUR"
|
> NOTE: The `VERSION` variable is used to select an Airplane branch to download from. The available options are "LATEST" "1.17" "1.16" "PURPUR" and "PURPUR-1.16"
|
||||||
|
|
||||||
Extra variables:
|
Extra variables:
|
||||||
- `AIRPLANE_BUILD=lastSuccessfulBuild` : set a specific Airplane build to use
|
- `AIRPLANE_BUILD=lastSuccessfulBuild` : set a specific Airplane build to use
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
image: itzg/minecraft-server
|
image: itzg/minecraft-server
|
||||||
container_name: paper
|
|
||||||
environment:
|
environment:
|
||||||
EULA: "true"
|
EULA: "true"
|
||||||
ENABLE_RCON: "true"
|
|
||||||
TYPE: PAPER
|
TYPE: PAPER
|
||||||
VIEW_DISTANCE: 10
|
VERSION: 1.9.4
|
||||||
MEMORY: 2G
|
# needed for Paper versions before 1.14
|
||||||
CONSOLE: "false"
|
CONSOLE: "false"
|
||||||
ports:
|
ports:
|
||||||
- 25565:25565
|
- 25565:25565
|
||||||
volumes:
|
volumes:
|
||||||
- mc-paper:/data
|
- mc-paper:/data
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
volumes:
|
||||||
mc-paper:
|
mc-paper:
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ current_uptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java_running() {
|
java_running() {
|
||||||
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
java_process_exists() {
|
java_process_exists() {
|
||||||
[[ -n "$(ps -a -o comm | grep 'java')" ]]
|
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
rcon_client_exists() {
|
rcon_client_exists() {
|
||||||
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
|
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
mc_server_listening() {
|
mc_server_listening() {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
[unpauseMCServer-server]
|
[unpauseMCServer-server]
|
||||||
sequence = 25565
|
sequence = 25565
|
||||||
seq_timeout = 1
|
seq_timeout = 1
|
||||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
[unpauseMCServer-rcon]
|
[unpauseMCServer-rcon]
|
||||||
sequence = 25575
|
sequence = 25575
|
||||||
seq_timeout = 1
|
seq_timeout = 1
|
||||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
[unpauseMCServer-bedrock]
|
[unpauseMCServer-bedrock]
|
||||||
sequence = 19132:udp
|
sequence = 19132:udp
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||||
# save world
|
# save world
|
||||||
rcon-cli save-all >/dev/null
|
rcon-cli save-all >/dev/null
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||||
logAutopauseAction "Knocked, resuming Java process"
|
logAutopauseAction "Knocked, resuming Java process"
|
||||||
pkill -CONT java
|
pkill -CONT java
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
|||||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||||
else
|
else
|
||||||
exec ${SCRIPTS:-/}start-configuration $@
|
exec ${SCRIPTS:-/}start-configuration $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ fi
|
|||||||
|
|
||||||
if ! which java > /dev/null; then
|
if ! which java > /dev/null; then
|
||||||
log "Fixing PATH to include java"
|
log "Fixing PATH to include java"
|
||||||
PATH="${PATH}:/usr/bin"
|
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||||
@@ -115,6 +115,14 @@ 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 "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -122,7 +130,15 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
FTBA)
|
||||||
|
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
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 "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -167,6 +183,12 @@ 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" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ isDebugging && set -x
|
|||||||
|
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] ; then
|
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
|
||||||
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=PURPUR. Note that these are branches, not #.#.# versions."
|
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -18,11 +18,20 @@ if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
|||||||
AIRPLANE_BRANCH="1.17"
|
AIRPLANE_BRANCH="1.17"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${VERSION}" = "1.16" ]; then
|
||||||
|
AIRPLANE_BRANCH="1.16"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${VERSION}" = "PURPUR" ]; then
|
if [ "${VERSION}" = "PURPUR" ]; then
|
||||||
AIRPLANE_BRANCH="Purpur-1.17"
|
AIRPLANE_BRANCH="Purpur-1.17"
|
||||||
AIRPLANE_TYPE="airplanepurpur"
|
AIRPLANE_TYPE="airplanepurpur"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${VERSION}" = "PURPUR-1.16" ]; then
|
||||||
|
AIRPLANE_BRANCH="Purpur-1.16"
|
||||||
|
AIRPLANE_TYPE="airplanepurpur"
|
||||||
|
fi
|
||||||
|
|
||||||
log "Using Airplane-${AIRPLANE_BRANCH} branch"
|
log "Using Airplane-${AIRPLANE_BRANCH} branch"
|
||||||
|
|
||||||
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
|
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
|
||||||
|
|||||||
@@ -85,8 +85,6 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
forgeInstallerJar=$(ls -t "${forgeInstallerJar}" | head -1)
|
|
||||||
|
|
||||||
log "Installing forge server"
|
log "Installing forge server"
|
||||||
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
||||||
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ if [ ! -d "$librariesDir" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir "$librariesDir"
|
|
||||||
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
||||||
log "ERROR: failed to unzip Crucible libraries"
|
log "ERROR: failed to unzip Crucible libraries"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -2,31 +2,27 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# shellcheck source=start-utils
|
# shellcheck source=start-utils
|
||||||
. "${SCRIPTS:-/}start-utils"
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
requireVar VANILLA_VERSION
|
requireVar VANILLA_VERSION
|
||||||
export TYPE=FABRIC
|
export TYPE=FABRIC
|
||||||
: "${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}"
|
export SERVER=fabric-server-${VANILLA_VERSION}.jar
|
||||||
: "${FABRIC_INSTALLER:=}"
|
|
||||||
: "${FABRIC_INSTALLER_URL:=}"
|
|
||||||
: "${FABRIC_LOADER_VERSION:=LATEST}"
|
|
||||||
|
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
log "Checking Fabric version information."
|
if [[ ! -e ${SERVER} ]]; then
|
||||||
if [[ $FABRIC_INSTALLER ]]; then
|
|
||||||
FABRIC_INSTALLER_VERSION=$(echo -n "$FABRIC_INSTALLER" | mc-image-helper hash)
|
|
||||||
elif [[ $FABRIC_INSTALLER_URL ]]; then
|
|
||||||
FABRIC_INSTALLER_VERSION=$(echo -n "$FABRIC_INSTALLER_URL" | mc-image-helper hash)
|
|
||||||
elif [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
|
|
||||||
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
|
||||||
fi
|
|
||||||
|
|
||||||
export SERVER=fabric-server-${VANILLA_VERSION}-${FABRIC_INSTALLER_VERSION}.jar
|
: ${FABRIC_INSTALLER:=}
|
||||||
|
: ${FABRIC_INSTALLER_URL:=}
|
||||||
if [ ! \( -e ${SERVER} -a -e "server-${VANILLA_VERSION}.jar" \) ]; then
|
: ${FABRIC_LOADER_VERSION:=LATEST}
|
||||||
|
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
|
||||||
|
|
||||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
|
log "Checking Fabric version information."
|
||||||
|
if [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
|
||||||
|
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||||
|
fi
|
||||||
|
|
||||||
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||||
@@ -70,12 +66,8 @@ if [ ! \( -e ${SERVER} -a -e "server-${VANILLA_VERSION}.jar" \) ]; then
|
|||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mv server.jar "server-${VANILLA_VERSION}.jar"
|
|
||||||
mv fabric-server-launch.jar "${SERVER}"
|
mv fabric-server-launch.jar "${SERVER}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Specify which server jar to run
|
|
||||||
echo "serverJar=server-${VANILLA_VERSION}.jar" > fabric-server-launcher.properties
|
|
||||||
|
|
||||||
export FAMILY=FABRIC
|
export FAMILY=FABRIC
|
||||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
exec ${SCRIPTS:-/}start-setupWorld "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user