Skip to content

Commit f88cb8e

Browse files
authored
neoforge: handle new version ordering (#3703)
1 parent 18f69b7 commit f88cb8e

File tree

5 files changed

+57
-25
lines changed

5 files changed

+57
-25
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
4848
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
4949
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
5050

51-
ARG MC_HELPER_VERSION=1.49.1
51+
ARG MC_HELPER_VERSION=1.49.2
5252
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
5353
# used for cache busting local copy of mc-image-helper
5454
ARG MC_HELPER_REV=1
17.2 KB
Loading

docs/mods-and-plugins/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ The newline delimiting allows for compose file usage like:
133133
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
134134
```
135135

136+
!!! note "Auto-removal"
137+
138+
Entries that are removed from the `MODS` or `PLUGINS` list will be automatically removed from the `mods` or `plugins` directory. This is useful for removing mods/plugins that are no longer needed. An empty `MODS` or `PLUGINS` list will remove all mods/plugins.
139+
140+
!!! note "Disable processing"
141+
142+
To temporarily disable processing of the `MODS` or `PLUGINS` list, then comment out the `MODS` or `PLUGINS` environment variable.
143+
136144
## Mod/Plugin URL Listing File
137145

138146
As an alternative to `MODS`/`PLUGINS`, the variable `MODS_FILE` or `PLUGINS_FILE` can be set with the container path or URL of a text file listing a mod/plugin URLs on each line. For example, the following

docs/mods-and-plugins/modrinth.md

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,46 @@
22

33
[Modrinth](https://modrinth.com/) is an open source modding platform with a clean, easy to use website for finding [Fabric, Forge, etc mods](https://modrinth.com/mods) and [Paper, etc plugins](https://modrinth.com/plugins), and [datapacks](https://modrinth.com/datapacks). At startup, the container will automatically locate and download the newest versions of mod/plugin files that correspond to the `TYPE` and `VERSION` in use. Older file versions downloaded previously will automatically be cleaned up.
44

5-
- **MODRINTH_PROJECTS** : comma or newline separated list of project slugs (short name) or IDs. The project ID is located in the "Technical information" section. The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example:
6-
```
5+
## Usage
6+
7+
To use this feature, set the environment variable `MODRINTH_PROJECTS` to a comma or newline separated list of project slugs (short name) or IDs.
8+
9+
!!! tip "Project ID"
10+
11+
The project ID can be copied to the clipboard from the project page menu:
12+
13+
![Modrinth copy project ID](../img/modrinth-copy-project-id.png)
14+
15+
!!! tip "Project Slug"
16+
17+
The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example:
18+
19+
```
720
https://modrinth.com/mod/fabric-api
821
----------
922
|
1023
+-- project slug
11-
```
12-
Also, a specific version (or release type) can be declared adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.
13-
14-
To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.
15-
16-
You can also reference a file containing project entries by prefixing the **container path** path with `@`.
17-
18-
| Description | Example projects entry |
19-
|---------------------------------|-------------------------------------------------------|
20-
| Select latest version | `fabric-api` |
21-
| Select specific version | `fabric-api:bQZpGIz0`<br/>`fabric-api:0.119.2+1.21.4` |
22-
| Select latest beta version | `fabric-api:beta` |
23-
| Latest version using project ID | `P7dR8mSH` |
24-
| Latest version of datapack | `datapack:terralith` |
25-
| Specific version of datapack | `datapack:terralith:2.5.5` |
26-
| Projects Listing File | `@/path/to/modrinth-mods.txt` |
24+
```
25+
26+
Also, a specific version (or release type) can be declared by adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.
27+
28+
To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.
29+
30+
You can also reference a file containing project entries by prefixing the **container path** path with `@`.
31+
32+
### Examples
33+
34+
| Description | Example projects entry |
35+
|---------------------------------|-------------------------------------------------------|
36+
| Select latest version | `fabric-api` |
37+
| Select specific version | `fabric-api:bQZpGIz0`<br/>`fabric-api:0.119.2+1.21.4` |
38+
| Select latest beta version | `fabric-api:beta` |
39+
| Latest version using project ID | `P7dR8mSH` |
40+
| Latest version of datapack | `datapack:terralith` |
41+
| Specific version of datapack | `datapack:terralith:2.5.5` |
42+
| Projects Listing File | `@/path/to/modrinth-mods.txt` |
43+
44+
### Notes
2745

2846
!!! info "More about listing files"
2947

@@ -42,6 +60,14 @@
4260
datapack:terralith
4361
```
4462

63+
!!! note "Auto-removal"
64+
65+
Entries that are removed from the `MODRINTH_PROJECTS` list will be automatically removed from the `mods` or `plugins` directory. This is useful for removing mods/plugins that are no longer needed. An empty `MODRINTH_PROJECTS` list will remove all mods/plugins.
66+
67+
!!! note "Disable processing"
68+
69+
To temporarily disable processing of the `MODRINTH_PROJECTS` list, then comment out the `MODRINTH_PROJECTS` environment variable.
70+
4571
## Version from Projects
4672

4773
When the environment variable `VERSION_FROM_MODRINTH_PROJECTS` is set to "true" the Minecraft [`VERSION`](../versions/minecraft.md) will be automatically determined by looking at the most recent version of Minecraft that is supported by all the projects provided in `MODRINTH_PROJECTS`.

scripts/start-setupModpack

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
set -e -o pipefail
44

55
: "${REMOVE_OLD_MODS:=false}"
6-
: "${MODS:=}"
76
: "${MODS_OUT_DIR:=/data/mods}"
87
: "${MODS_FILE:=}"
9-
: "${PLUGINS:=}"
108
: "${PLUGINS_OUT_DIR:=/data/plugins}"
119
: "${PLUGINS_FILE:=}"
1210
: "${REMOVE_OLD_MODS_DEPTH:=1} "
@@ -94,7 +92,7 @@ fi
9492

9593
function handleListings() {
9694
if usesMods && usesPlugins; then
97-
if [[ "$MODS" ]]; then
95+
if [[ -v MODS ]]; then
9896

9997
ensureRemoveAllModsOff "MODS is set"
10098

@@ -105,7 +103,7 @@ function handleListings() {
105103
--to="$MODS_OUT_DIR" \
106104
"$MODS"
107105
fi
108-
if [[ "$PLUGINS" ]]; then
106+
if [[ -v PLUGINS ]]; then
109107
ensureRemoveAllModsOff "PLUGINS is set"
110108
mkdir -p "$PLUGINS_OUT_DIR"
111109
mc-image-helper mcopy \
@@ -140,14 +138,14 @@ function handleListings() {
140138
outDir="$PLUGINS_OUT_DIR"
141139
fi
142140

143-
if [[ "$MODS" || "$PLUGINS" ]]; then
141+
if [[ -v MODS || -v PLUGINS ]]; then
144142
ensureRemoveAllModsOff "MODS or PLUGINS is set"
145143
mkdir -p "$outDir"
146144
mc-image-helper mcopy \
147145
--glob=*.jar \
148146
--scope=var-list \
149147
--to="$outDir" \
150-
"$MODS" "$PLUGINS"
148+
"${MODS:-}" "${PLUGINS:-}"
151149
fi
152150

153151
if [[ "$MODS_FILE" || "$PLUGINS_FILE" ]]; then

0 commit comments

Comments
 (0)