Skip to content

Commit 8463893

Browse files
authored
fabric: add option to force reinstall (#3559)
1 parent 5b79daa commit 8463893

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

docs/types-and-platforms/server-types/fabric.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,27 @@ A specific loader or launcher version other than the latest can be requested usi
4141
FABRIC_LOADER_VERSION: 0.13.1
4242
```
4343

44-
!!! note "Fabric API"
44+
!!! note
4545

46-
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:
47-
48-
```yaml
49-
TYPE: FABRIC
50-
MODRINTH_PROJECTS: |
51-
fabric-api
52-
```
46+
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration.
47+
48+
## Fabric API
49+
50+
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:
51+
52+
```yaml
53+
TYPE: FABRIC
54+
MODRINTH_PROJECTS: |
55+
fabric-api
56+
```
57+
58+
## Alternate launcher
5359
54-
!!! note "Alternate launcher"
60+
If you wish to use an alternative launcher you can:
5561
56-
If you wish to use an alternative launcher you can:
62+
- 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`)
63+
- Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`)
5764

58-
- 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`)
59-
- Provide the URL to a custom launcher jar with `FABRIC_LAUNCHER_URL` (such as `-e FABRIC_LAUNCHER_URL=http://HOST/fabric-server-custom.jar`)
65+
## Force re-install
6066

61-
See the [Working with mods and plugins](../../mods-and-plugins/index.md) section to set up Fabric mods and configuration.
67+
If the Fabric launcher jar becomes corrupted you can temporarily set FABRIC_FORCE_REINSTALL to "true" to have it re-installed on next startup.

scripts/start-deployFabric

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ export TYPE=FABRIC
99
: "${FABRIC_LAUNCHER:=}"
1010
: "${FABRIC_LAUNCHER_URL:=}"
1111
: "${FABRIC_LOADER_VERSION:=LATEST}"
12+
: "${FABRIC_FORCE_REINSTALL:=false}"
1213

1314
resultsFile=/data/.install-fabric.env
1415

1516
isDebugging && set -x
1617

18+
commonArgs=(
19+
--results-file="${resultsFile}"
20+
)
21+
if isTrue "${FABRIC_FORCE_REINSTALL}"; then
22+
log "Forcing re-install of Fabric"
23+
commonArgs+=(--force-reinstall)
24+
fi
25+
1726
# Custom fabric jar
1827
if [[ $FABRIC_LAUNCHER ]]; then
1928
if ! mc-image-helper install-fabric-loader \
20-
--results-file=${resultsFile} \
29+
"${commonArgs[@]}" \
2130
--from-local-file="$FABRIC_LAUNCHER"; then
2231
logError "Failed to use provided Fabric launcher"
2332
exit 1
@@ -26,7 +35,7 @@ if [[ $FABRIC_LAUNCHER ]]; then
2635
# Custom fabric jar url
2736
elif [[ $FABRIC_LAUNCHER_URL ]]; then
2837
if ! mc-image-helper install-fabric-loader \
29-
--results-file=${resultsFile} \
38+
"${commonArgs[@]}" \
3039
--from-url="$FABRIC_LAUNCHER_URL"; then
3140
logError "Failed to installFabric launcher from $FABRIC_LAUNCHER_URL"
3241
exit 1
@@ -35,7 +44,7 @@ elif [[ $FABRIC_LAUNCHER_URL ]]; then
3544
# Official fabric launcher
3645
else
3746
if ! mc-image-helper install-fabric-loader \
38-
--results-file=${resultsFile} \
47+
"${commonArgs[@]}" \
3948
--minecraft-version="${VERSION}" \
4049
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
4150
--loader-version="${FABRIC_LOADER_VERSION}"; then

0 commit comments

Comments
 (0)