Skip to content

Commit 08e59cd

Browse files
committed
feat: share Fabric and NeoForge runtime with Architectury
1 parent 7747e2a commit 08e59cd

88 files changed

Lines changed: 3837 additions & 1066 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/fabric-smoke.py‎

Lines changed: 4 additions & 280 deletions
Large diffs are not rendered by default.

‎.github/scripts/mod-smoke.py‎

Lines changed: 554 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/scripts/modrinth-names.py‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
PROJECT_ID = "VW7EmMIj"
2222
API = "https://api.modrinth.com/v2"
23-
FABRIC_GAMES = {"26.1.2", "26.2"}
23+
MOD_GAMES = {"26.1.2", "26.2"}
2424
USER_AGENT = "EClean-Modern/version-names (https://github.com/MeowCat-Team/EClean-modern)"
2525
GUARDED_FIELDS = (
2626
"id", "project_id", "files", "dependencies", "loaders", "game_versions", "changelog",
@@ -136,6 +136,8 @@ def build_plan(versions: Any, base: str) -> list[Rename]:
136136
selected.append((version, "paper"))
137137
elif number.startswith(base + "+fabric."):
138138
selected.append((version, "fabric"))
139+
elif number.startswith(base + "+neoforge."):
140+
selected.append((version, "neoforge"))
139141
if not selected:
140142
raise RenameError(f"No existing versions match base_version {base}; nothing was modified")
141143

@@ -154,10 +156,11 @@ def build_plan(versions: Any, base: str) -> list[Rename]:
154156
loader_set = set(loaders)
155157
if len(loader_set) != len(loaders):
156158
raise RenameError(f"Version {version_id} has duplicate loaders")
157-
if loader_set == {"fabric"}:
158-
platform, label = "fabric", "Fabric"
159-
if len(games) != 1 or games[0] not in FABRIC_GAMES:
160-
raise RenameError(f"Fabric version {version_id} must have one supported game version (26.1.2 or 26.2)")
159+
if loader_set in ({"fabric"}, {"neoforge"}):
160+
platform = next(iter(loader_set))
161+
label = "Fabric" if platform == "fabric" else "NeoForge"
162+
if len(games) != 1 or games[0] not in MOD_GAMES:
163+
raise RenameError(f"{label} version {version_id} must have one supported game version (26.1.2 or 26.2)")
161164
game = games[0]
162165
elif loader_set <= {"paper", "folia"}:
163166
platform, label = "paper", "Paper / Folia"
@@ -169,7 +172,7 @@ def build_plan(versions: Any, base: str) -> list[Rename]:
169172
raise RenameError(f"Paper version {version_id} has gaps in its declared compatibility range")
170173
game = ordered[0] if len(ordered) == 1 else f"{ordered[0]}-{ordered[-1]}"
171174
else:
172-
raise RenameError(f"Version {version_id} is not exclusively Paper/Folia or Fabric")
175+
raise RenameError(f"Version {version_id} is not exclusively Paper/Folia, Fabric, or NeoForge")
173176
target_number = f"{base}+{platform}.{game}"
174177
if suffix is not None and (suffix != platform or version["version_number"] != target_number):
175178
raise RenameError(f"Version {version_id} platform suffix does not match its loaders and game version")

‎.github/workflows/build.yml‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build
22

33
on:
44
pull_request:
5-
branches: [modern]
5+
branches: [architectury]
66
push:
7-
branches: [modern]
7+
branches: [architectury]
88

99
permissions:
1010
contents: read
@@ -111,11 +111,12 @@ jobs:
111111
include-hidden-files: true
112112
if-no-files-found: ignore
113113

114-
fabric:
114+
mods:
115115
runs-on: ubuntu-latest
116116
strategy:
117117
fail-fast: false
118118
matrix:
119+
loader: [fabric, neoforge]
119120
minecraft: ["26.1.2", "26.2"]
120121
steps:
121122
- name: Checkout
@@ -130,27 +131,28 @@ jobs:
130131
- name: Set up Gradle
131132
uses: gradle/actions/setup-gradle@0b6dd653ba04f4f93bf581ec31e66cbd7dcb644d # v4
132133

133-
- name: Build and test Fabric
134-
run: ./gradlew :common:check :fabric:build -PminecraftVersion=${{ matrix.minecraft }}
134+
- name: Build and test server mod
135+
run: ./gradlew :common:check :mod-common:check :${{ matrix.loader }}:build -PminecraftVersion=${{ matrix.minecraft }}
135136

136-
- name: Smoke test packaged Fabric mod
137+
- name: Smoke test packaged server mod
137138
timeout-minutes: 10
138-
run: python3 .github/scripts/fabric-smoke.py ${{ matrix.minecraft }}
139+
run: python3 .github/scripts/mod-smoke.py ${{ matrix.loader }} ${{ matrix.minecraft }}
139140

140-
- name: Upload Fabric smoke logs
141+
- name: Upload server mod smoke logs and report
141142
if: always()
142143
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
143144
with:
144-
name: EClean-Fabric-smoke-${{ matrix.minecraft }}
145+
name: EClean-${{ matrix.loader }}-smoke-${{ matrix.minecraft }}
145146
path: |
146-
.local/fabric-smoke/${{ matrix.minecraft }}/smoke-console.log
147-
.local/fabric-smoke/${{ matrix.minecraft }}/logs/latest.log
147+
.local/${{ matrix.loader }}-smoke/${{ matrix.minecraft }}/smoke-console.log
148+
.local/${{ matrix.loader }}-smoke/${{ matrix.minecraft }}/smoke-report.json
149+
.local/${{ matrix.loader }}-smoke/${{ matrix.minecraft }}/logs/latest.log
148150
include-hidden-files: true
149151
if-no-files-found: ignore
150152

151-
- name: Upload Fabric mod
153+
- name: Upload server mod
152154
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
153155
with:
154-
name: EClean-Modern-Fabric-${{ matrix.minecraft }}
155-
path: fabric/build/${{ matrix.minecraft }}/libs/EClean-Modern-*-fabric-mc${{ matrix.minecraft }}.jar
156+
name: EClean-Modern-${{ matrix.loader }}-${{ matrix.minecraft }}
157+
path: ${{ matrix.loader }}/build/${{ matrix.minecraft }}/libs/EClean-Modern-*-${{ matrix.loader }}-mc${{ matrix.minecraft }}.jar
156158
if-no-files-found: error

‎.github/workflows/modrinth-names.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2626
with:
27-
ref: modern
27+
ref: architectury
2828
persist-credentials: false
2929

3030
- name: Validate and apply version names

‎.github/workflows/release.yml‎

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
1919
with:
20-
ref: modern
20+
ref: architectury
2121
fetch-depth: 0
2222

2323
- name: Read project version
@@ -82,8 +82,8 @@ jobs:
8282
- name: Build and test
8383
run: ./gradlew build
8484

85-
- name: Build and test Fabric 26.2
86-
run: ./gradlew :fabric:build -PminecraftVersion=26.2
85+
- name: Build and test Fabric and NeoForge 26.2
86+
run: ./gradlew :mod-common:check :fabric:build :neoforge:build -PminecraftVersion=26.2
8787

8888
- name: Test packaged Paper plugin on every supported version
8989
timeout-minutes: 30
@@ -121,20 +121,32 @@ jobs:
121121

122122
- name: Test packaged Fabric 26.1.2 server
123123
timeout-minutes: 10
124-
run: python3 .github/scripts/fabric-smoke.py 26.1.2
124+
run: python3 .github/scripts/mod-smoke.py fabric 26.1.2
125125

126126
- name: Test packaged Fabric 26.2 server
127127
timeout-minutes: 10
128-
run: python3 .github/scripts/fabric-smoke.py 26.2
128+
run: python3 .github/scripts/mod-smoke.py fabric 26.2
129129

130-
- name: Upload Fabric server test logs
130+
- name: Test packaged NeoForge 26.1.2 server
131+
timeout-minutes: 10
132+
run: python3 .github/scripts/mod-smoke.py neoforge 26.1.2
133+
134+
- name: Test packaged NeoForge 26.2 server
135+
timeout-minutes: 10
136+
run: python3 .github/scripts/mod-smoke.py neoforge 26.2
137+
138+
- name: Upload server mod test logs and reports
131139
if: always()
132140
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
133141
with:
134-
name: Fabric-release-server-logs
142+
name: Mod-release-server-logs
135143
path: |
136144
.local/fabric-smoke/*/smoke-console.log
145+
.local/fabric-smoke/*/smoke-report.json
137146
.local/fabric-smoke/*/logs/latest.log
147+
.local/neoforge-smoke/*/smoke-console.log
148+
.local/neoforge-smoke/*/smoke-report.json
149+
.local/neoforge-smoke/*/logs/latest.log
138150
include-hidden-files: true
139151
if-no-files-found: ignore
140152

@@ -167,6 +179,8 @@ jobs:
167179
paper/build/libs/EClean-Modern-*-paper.jar
168180
fabric/build/26.1.2/libs/EClean-Modern-*-fabric-mc26.1.2.jar
169181
fabric/build/26.2/libs/EClean-Modern-*-fabric-mc26.2.jar
182+
neoforge/build/26.1.2/libs/EClean-Modern-*-neoforge-mc26.1.2.jar
183+
neoforge/build/26.2/libs/EClean-Modern-*-neoforge-mc26.2.jar
170184
fail_on_unmatched_files: true
171185

172186
publish-modrinth:
@@ -202,39 +216,60 @@ jobs:
202216
game-versions: ${{ needs.release.outputs.game-versions }}
203217
java: '25'
204218

205-
publish-modrinth-fabric:
219+
publish-modrinth-mods:
206220
needs: release
207221
runs-on: ubuntu-latest
208222
permissions:
209223
contents: read
210224
strategy:
211225
fail-fast: false
212226
matrix:
213-
minecraft: ['26.1.2', '26.2']
227+
include:
228+
- loader: fabric
229+
label: Fabric
230+
minecraft: '26.1.2'
231+
dependencies: |
232+
fabric-api(required)
233+
architectury-api(required)
234+
- loader: fabric
235+
label: Fabric
236+
minecraft: '26.2'
237+
dependencies: |
238+
fabric-api(required)
239+
architectury-api(required)
240+
- loader: neoforge
241+
label: NeoForge
242+
minecraft: '26.1.2'
243+
dependencies: 'architectury-api(required)'
244+
- loader: neoforge
245+
label: NeoForge
246+
minecraft: '26.2'
247+
dependencies: 'architectury-api(required)'
214248
steps:
215-
- name: Download Fabric release artifact
249+
- name: Download server mod release artifact
216250
env:
217251
GH_TOKEN: ${{ github.token }}
218252
RELEASE_VERSION: ${{ needs.release.outputs.version }}
219253
MINECRAFT_VERSION: ${{ matrix.minecraft }}
254+
MOD_LOADER: ${{ matrix.loader }}
220255
run: |
221256
gh release download "v$RELEASE_VERSION" --repo "$GITHUB_REPOSITORY" \
222-
--pattern "EClean-Modern-*-fabric-mc$MINECRAFT_VERSION.jar" --dir release
257+
--pattern "EClean-Modern-*-$MOD_LOADER-mc$MINECRAFT_VERSION.jar" --dir release
223258
gh release view "v$RELEASE_VERSION" --repo "$GITHUB_REPOSITORY" \
224259
--json body --jq .body > release_notes.md
225260
226-
- name: Publish Fabric to Modrinth
261+
- name: Publish server mod to Modrinth
227262
uses: Kira-NT/mc-publish@52307b03863581dec6b652b83e597aec02ebb075 # v3.3
228263
with:
229264
modrinth-id: VW7EmMIj # ecl-modern
230265
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
231-
files: release/EClean-Modern-*-fabric-mc${{ matrix.minecraft }}.jar
232-
modrinth-name: ${{ needs.release.outputs.version }} (Fabric, MC ${{ matrix.minecraft }})
233-
modrinth-version: ${{ needs.release.outputs.version }}+fabric.${{ matrix.minecraft }}
266+
files: release/EClean-Modern-*-${{ matrix.loader }}-mc${{ matrix.minecraft }}.jar
267+
modrinth-name: ${{ needs.release.outputs.version }} (${{ matrix.label }}, MC ${{ matrix.minecraft }})
268+
modrinth-version: ${{ needs.release.outputs.version }}+${{ matrix.loader }}.${{ matrix.minecraft }}
234269
version-type: release
235270
changelog-file: release_notes.md
236-
loaders: fabric
271+
loaders: ${{ matrix.loader }}
237272
environment: server
238273
game-versions: ${{ matrix.minecraft }}
239-
modrinth-dependencies: fabric-api(required)
274+
modrinth-dependencies: ${{ matrix.dependencies }}
240275
java: '25'

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ run
99
.local
1010
/.planning/
1111
/fabric/logs/
12+
/mod-common/logs/
1213
__pycache__/

‎README-zh.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English](README.md) | 简体中文
44

5-
面向 Paper / Folia 的实体清理插件,同时支持 Fabric 26.1.2 / 26.2 服务端,基于 [EClean](https://github.com/4o4E/EClean) 开发。支持定时清理、规则保护、清理预览、共享垃圾桶和可视化统计。
5+
面向 Paper / Folia 的实体清理插件,同时通过 Architectury 支持 Fabric 和 NeoForge 26.1.2 / 26.2 服务端,基于 [EClean](https://github.com/4o4E/EClean) 开发。支持定时清理、规则保护、清理预览、共享垃圾桶和可视化统计。开发主分支为 `architectury`。
66

77
[下载](https://github.com/MeowCat-Team/EClean-modern/releases/latest) · [更新日志](docs/Changelog-zh.md) · [English changelog](docs/Changelog.md)
88

@@ -14,7 +14,7 @@
1414

1515
垃圾桶内容不跨重启保留。更新插件时请完整停服后替换 JAR。
1616

17-
Fabric 服务端请将匹配 **26.1.2 或 26.2** 的模组 JAR、对应 Fabric API 放入 `mods/`,并使用 Fabric Loader 0.19.5 或更新版本。配置生成于 `config/eclean/`,客户端无需安装模组。版本要求、权限与平台差异见 [Fabric 使用说明](docs/Fabric-zh.md)。
17+
Fabric 或 NeoForge 服务端请将匹配 **26.1.2 或 26.2** 的 EClean 与 Architectury API 放入 `mods/`;Fabric 还需对应的 Fabric API。配置生成于 `config/eclean/`,客户端无需安装模组。具体依赖、权限与安装方法见 [Fabric 使用说明](docs/Fabric-zh.md) 或 [NeoForge 使用说明](docs/NeoForge-zh.md)。
1818

1919
## 常用命令
2020

@@ -36,5 +36,6 @@ Fabric 服务端请将匹配 **26.1.2 或 26.2** 的模组 JAR、对应 Fabric A
3636
- [权限列表](docs/Permissions-zh.md)
3737
- [Paper 版本与兼容性验证](docs/Paper-zh.md)
3838
- [Fabric 安装与兼容性](docs/Fabric-zh.md)
39+
- [NeoForge 安装与兼容性](docs/NeoForge-zh.md)
3940
- [PlaceholderAPI 占位符](docs/Placeholders-zh.md)
4041
- [构建与依赖更新](docs/Building-zh.md)

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
English | [简体中文](README-zh.md)
44

5-
An entity cleanup plugin for Paper / Folia and a server mod for Fabric 26.1.2 / 26.2, based on [EClean](https://github.com/4o4E/EClean). Supports scheduled cleanup, protection rules, cleanup previews, a shared trash can, and visual statistics.
5+
An entity cleanup plugin for Paper / Folia and an Architectury server mod for Fabric and NeoForge 26.1.2 / 26.2, based on [EClean](https://github.com/4o4E/EClean). Supports scheduled cleanup, protection rules, cleanup previews, a shared trash can, and visual statistics. Development takes place on the `architectury` branch.
66

77
[Download](https://github.com/MeowCat-Team/EClean-modern/releases/latest) · [Changelog](docs/Changelog.md)
88

@@ -14,7 +14,7 @@ An entity cleanup plugin for Paper / Folia and a server mod for Fabric 26.1.2 /
1414

1515
Trash-can contents do not survive server restarts. Shut down the server completely before replacing the plugin JAR.
1616

17-
For Fabric, install the JAR matching **26.1.2 or 26.2**, Fabric Loader 0.19.5 or newer, and the matching Fabric API in `mods/`. Configuration is generated under `config/eclean/`. Clients need no mod. See the [Fabric guide](docs/Fabric.md) for versions, permissions, and platform differences.
17+
For Fabric or NeoForge, install the EClean JAR and Architectury API matching **26.1.2 or 26.2** in `mods/`. Fabric additionally requires Fabric API. Configuration is generated under `config/eclean/`; clients need no mod. See the [Fabric guide](docs/Fabric.md) or [NeoForge guide](docs/NeoForge.md) for exact dependencies, permissions, and installation.
1818

1919
## Common commands
2020

@@ -36,5 +36,6 @@ The main command is `/eclean`, with `/ecl` as an alias. Commands require OP perm
3636
- [Permissions](docs/Permissions.md)
3737
- [Paper versions and compatibility checks](docs/Paper.md)
3838
- [Fabric installation and compatibility](docs/Fabric.md)
39+
- [NeoForge installation and compatibility](docs/NeoForge.md)
3940
- [PlaceholderAPI variables](docs/Placeholders.md)
4041
- [Building and updating dependencies](docs/Building.md)

‎build.gradle.kts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@ plugins {
33
alias(libs.plugins.kotlin.serialization) apply false
44
alias(libs.plugins.shadow) apply false
55
alias(libs.plugins.run.paper) apply false
6+
alias(libs.plugins.architectury.loom) apply false
7+
alias(libs.plugins.architectury.plugin)
68
}
79

10+
val minecraftVersion = providers.gradleProperty("minecraftVersion").getOrElse("26.1.2")
11+
require(minecraftVersion in setOf("26.1.2", "26.2")) {
12+
"EClean mods support Minecraft 26.1.2 and 26.2; received '$minecraftVersion'."
13+
}
14+
architectury {
15+
minecraft = minecraftVersion
16+
}
17+
// Select NeoForge before its Loom plugin is applied. Paper and common never apply Loom.
18+
project(":neoforge").extensions.extraProperties["loom.platform"] = "neoforge"
19+
820
allprojects {
921
group = "org.meowcat"
10-
version = "0.3.5"
22+
version = "0.3.6"
1123

1224
repositories {
1325
mavenCentral()

0 commit comments

Comments
 (0)