mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-26 15:40:30 +00:00
Add option to specify specific Fabric loader version (#1073)
This commit is contained in:
@@ -549,6 +549,13 @@ docker run -d -v /path/on/host:/data ... \
|
|||||||
-e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
-e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A specific loader version can be requested using `FABRIC_LOADER_VERSION`, such as:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -d -v /path/on/host:/data ... \
|
||||||
|
-e FABRIC_LOADER_VERSION=0.11.7
|
||||||
|
```
|
||||||
|
|
||||||
In order to add mods, you have two options:
|
In order to add mods, you have two options:
|
||||||
|
|
||||||
### Running a Limbo server
|
### Running a Limbo server
|
||||||
|
|||||||
+9
-1
@@ -14,6 +14,7 @@ if [[ ! -e ${SERVER} ]]; then
|
|||||||
|
|
||||||
: ${FABRIC_INSTALLER:=}
|
: ${FABRIC_INSTALLER:=}
|
||||||
: ${FABRIC_INSTALLER_URL:=}
|
: ${FABRIC_INSTALLER_URL:=}
|
||||||
|
: ${FABRIC_LOADER_VERSION:=LATEST}
|
||||||
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
|
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
|
||||||
|
|
||||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
@@ -31,6 +32,12 @@ if [[ ! -e ${SERVER} ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z $FABRIC_LOADER_VERSION || ${FABRIC_LOADER_VERSION^^} = LATEST ]]; then
|
||||||
|
log "Checking Fabric Loader version information."
|
||||||
|
|
||||||
|
FABRIC_LOADER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml)
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||||
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
|
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
|
||||||
@@ -39,13 +46,14 @@ if [[ ! -e ${SERVER} ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER with loader version $FABRIC_LOADER_VERSION"
|
||||||
|
|
||||||
tries=3
|
tries=3
|
||||||
set +e
|
set +e
|
||||||
while ((--tries >= 0)); do
|
while ((--tries >= 0)); do
|
||||||
java -jar $FABRIC_INSTALLER server \
|
java -jar $FABRIC_INSTALLER server \
|
||||||
-mcversion $VANILLA_VERSION \
|
-mcversion $VANILLA_VERSION \
|
||||||
|
-loader $FABRIC_LOADER_VERSION \
|
||||||
-downloadMinecraft \
|
-downloadMinecraft \
|
||||||
-dir /data
|
-dir /data
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user