Add option to specify specific Fabric loader version (#1073)

This commit is contained in:
Marijn 2021-10-17 21:43:41 +02:00 committed by GitHub
parent 6008660a81
commit ee7f2ee739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -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 ...
```
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:
### Running a Limbo server

View File

@ -14,6 +14,7 @@ if [[ ! -e ${SERVER} ]]; then
: ${FABRIC_INSTALLER:=}
: ${FABRIC_INSTALLER_URL:=}
: ${FABRIC_LOADER_VERSION:=LATEST}
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
@ -31,6 +32,12 @@ if [[ ! -e ${SERVER} ]]; then
exit 2
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
log "Downloading $FABRIC_INSTALLER_URL ..."
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
@ -39,13 +46,14 @@ if [[ ! -e ${SERVER} ]]; then
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
set +e
while ((--tries >= 0)); do
java -jar $FABRIC_INSTALLER server \
-mcversion $VANILLA_VERSION \
-loader $FABRIC_LOADER_VERSION \
-downloadMinecraft \
-dir /data
if [[ $? == 0 ]]; then