diff --git a/docs/types-and-platforms/server-types/fabric.md b/docs/types-and-platforms/server-types/fabric.md index 71881b22..4a08def4 100644 --- a/docs/types-and-platforms/server-types/fabric.md +++ b/docs/types-and-platforms/server-types/fabric.md @@ -41,21 +41,27 @@ A specific loader or launcher version other than the latest can be requested usi FABRIC_LOADER_VERSION: 0.13.1 ``` -!!! note "Fabric API" +!!! note - As [mentioned on the Fabric download page](https://fabricmc.net/use/installer/), most mods will require the Fabric API mod to be installed. That can be easily done by utilizing [the Modrinth downloads feature](../../mods-and-plugins/modrinth.md), such as adding this to the `environment` of a compose file service: - - ```yaml - TYPE: FABRIC - MODRINTH_PROJECTS: | - fabric-api - ``` + See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration. -!!! note "Alternate launcher" +## Fabric API - If you wish to use an alternative launcher you can: +As [mentioned on the Fabric download page](https://fabricmc.net/use/installer/), most mods will require the Fabric API mod to be installed. That can be easily done by utilizing [the Modrinth downloads feature](../../mods-and-plugins/modrinth.md), such as adding this to the `environment` of a compose file service: - - Provide the path to a custom launcher jar available to the container with `FABRIC_LAUNCHER`, relative to `/data` (such as `-e FABRIC_LAUNCHER=fabric-server-custom.jar`) - - Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`) +```yaml + TYPE: FABRIC + MODRINTH_PROJECTS: | + fabric-api +``` -See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration. +## Alternate launcher + +If you wish to use an alternative launcher you can: + +- Provide the path to a custom launcher jar available to the container with `FABRIC_LAUNCHER`, relative to `/data` (such as `-e FABRIC_LAUNCHER=fabric-server-custom.jar`) +- Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`) + +## Force re-install + +If the Fabric launcher jar becomes corrupted you can temporarily set FABRIC_FORCE_REINSTALL to "true" to have it re-installed on next startup. \ No newline at end of file diff --git a/scripts/start-deployFabric b/scripts/start-deployFabric index af89fedc..c6d5827f 100755 --- a/scripts/start-deployFabric +++ b/scripts/start-deployFabric @@ -9,15 +9,24 @@ export TYPE=FABRIC : "${FABRIC_LAUNCHER:=}" : "${FABRIC_LAUNCHER_URL:=}" : "${FABRIC_LOADER_VERSION:=LATEST}" +: "${FABRIC_FORCE_REINSTALL:=false}" resultsFile=/data/.install-fabric.env isDebugging && set -x +commonArgs=( + --results-file="${resultsFile}" +) +if isTrue "${FABRIC_FORCE_REINSTALL}"; then + log "Forcing re-install of Fabric" + commonArgs+=(--force-reinstall) +fi + # Custom fabric jar if [[ $FABRIC_LAUNCHER ]]; then if ! mc-image-helper install-fabric-loader \ - --results-file=${resultsFile} \ + "${commonArgs[@]}" \ --from-local-file="$FABRIC_LAUNCHER"; then logError "Failed to use provided Fabric launcher" exit 1 @@ -26,7 +35,7 @@ if [[ $FABRIC_LAUNCHER ]]; then # Custom fabric jar url elif [[ $FABRIC_LAUNCHER_URL ]]; then if ! mc-image-helper install-fabric-loader \ - --results-file=${resultsFile} \ + "${commonArgs[@]}" \ --from-url="$FABRIC_LAUNCHER_URL"; then logError "Failed to installFabric launcher from $FABRIC_LAUNCHER_URL" exit 1 @@ -35,7 +44,7 @@ elif [[ $FABRIC_LAUNCHER_URL ]]; then # Official fabric launcher else if ! mc-image-helper install-fabric-loader \ - --results-file=${resultsFile} \ + "${commonArgs[@]}" \ --minecraft-version="${VERSION}" \ --installer-version="${FABRIC_LAUNCHER_VERSION}" \ --loader-version="${FABRIC_LOADER_VERSION}"; then