Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/modern-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Modern Builds

on:
push:
pull_request:
workflow_dispatch:

jobs:
forge-1-20-1:
name: Forge 1.20.1
runs-on: ubuntu-latest
defaults:
run:
working-directory: versions/forge-1.20.1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: |
sed -i 's/\r$//' gradlew
chmod +x gradlew
./gradlew test build --no-daemon

neoforge-1-21-1:
name: NeoForge 1.21.1
runs-on: ubuntu-latest
defaults:
run:
working-directory: versions/neoforge-1.21.1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: |
sed -i 's/\r$//' gradlew
chmod +x gradlew
./gradlew test build --no-daemon
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

AE2 Smart Pattern System is a smart pattern extension for AE2 and AE2UEL.

It adds wildcard recipe expansion, item or fluid or gas marker support, recipe search, filter lists, and mod-based exclusion controls across multiple Minecraft version tracks.
It adds wildcard recipe expansion, item or fluid or gas marker support, recipe search, filter lists, and mod-based filtering across multiple Minecraft version tracks.

## Modern Pattern Filters

The Forge 1.20.1 and NeoForge 1.21.1 tracks support independent mod filters for
each pattern input and output:

- Each input and output can define its own mod whitelist and blacklist.
- Legacy `Excluded` data is migrated to the blacklist.
- An explicitly empty whitelist rejects all candidates; it does not mean
"allow everything".

## Version Tracks

Expand Down
99 changes: 41 additions & 58 deletions versions/forge-1.20.1/README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,60 @@
# Forge 1.20.1 路线 / Forge 1.20.1 Track
# AE2 Smart Pattern System - Forge 1.20.1

当前状态:可编译、可打开基础编辑器 GUI、可保存基础样板数据,且已接入 AE2 官方 API 解码器。
Current status: compilable, basic editor GUI opens, pattern data persists, and AE2 official API decoder is integrated.
This track targets Minecraft 1.20.1 on Forge and keeps the runtime namespace
`sampleintegration` for compatibility with the existing assets and metadata.

## 已完成 / Done
## Current Status

- [x] 模组引导与元数据。 / Mod bootstrap and metadata.
- [x] 物品与方块注册。 / Item and block registration.
- [x] 方块实体(18 槽)迁移。 / Block entity migration (18 slots).
- [x] 菜单与界面迁移(基础版)。 / Menu and screen migration (basic).
- [x] 样板 NBT 回写(打开读入、关闭写回)。 / Pattern NBT round-trip (load on open, save on close).
- [x] 基础 Tooltip 与本地化。 / Basic tooltip and localization.
- [x] 基础资源(model/blockstate/loot/recipes)。 / Basic assets (model/blockstate/loot/recipes).
- [x] AE2 软依赖接入(15.4.10)与解码器注册。 / AE2 soft integration (15.4.10) and decoder registration.
- [ ] AE2 自动下单执行链深度迁移。 / Deep migration of AE2 crafting execution chain.
- [ ] 黑白名单模式与流体/气体标记迁移。 / Filter mode and fluid/gas marker migration.
- The mod bootstrap, item and block registration, pattern editor menu, basic
editor screen, pattern NBT persistence, tooltip, and localization are
implemented.
- The Forge 1.20.1 build includes the shared core model and its JUnit 5 tests.
- AE2 official API decoding is integrated as a soft dependency.
- Fluid and gas marker data, item markers, wildcard expansion, and recipe-level
filter entries are supported.
- AE2 crafting execution-chain migration is still outside this track.

## 构建命令 / Build Commands
## Mod Filters

推荐使用本地脚本(已固定 Java 17 路径):
Use the local script (Java 17 path is pinned):
Each encoded pattern stores independent input and output mod filter rules.
Every side has its own mode:

```bat
cd migration\forge-1.20.1
build-dev.bat build --console=plain
```
- `WHITELIST`: only listed mod namespaces are allowed.
- `BLACKLIST`: listed mod namespaces are blocked.

启动客户端:
Run client:
The mod filter screen provides separate input and output mode buttons in the
sidebar. Left-click toggles the input list and right-click toggles the output
list. Row markers, tooltips, and blocked counts reflect the effective rule,
including whitelist behavior.

```bat
cd migration\forge-1.20.1
build-dev.bat runClient --console=plain
```
Canonical pattern keys are:

Safe dev run (temporarily disables incompatible AE2/GuideME/JEI jars in `run/mods` and restores them after run):
- `TechStartInputModFilterMode`
- `TechStartOutputModFilterMode`
- `TechStartInputModFilterIds`
- `TechStartOutputModFilterIds`

```bat
cd migration\forge-1.20.1
run-dev-safe.bat runClient --no-daemon
```
Older `ExcludedInputModIds` and `ExcludedOutputModIds` lists are read as
blacklists when canonical IDs are absent. Saving always writes canonical mode
data, removes legacy keys, and limits each side to 512 normalized IDs of at
most 64 characters.

```bat
cd migration\forge-1.20.1
run-dev-safe.bat runServer --no-daemon
```
Recipe-level filter entries remain a second, independent filter layer after
mod namespace filtering.

鏃ュ父寮€鍙戞祴璇曢粯璁や笉鍔犺浇 AE2 杩愯鏃讹紙閬垮厤宸叉柟 AE2 + Forge dev Mixin 鍐茬獊锛夈€?
Default dev run does not load AE2 runtime jars to avoid AE2 + Forge-dev mixin conflicts.
## Build

濡傞渶鍚敤 AE2 杩愯鏃讹紝鍙樉寮忎紶鍏ュ弬鏁帮細
To enable AE2 runtime explicitly:
Run from this directory:

```bat
cd migration\forge-1.20.1
build-dev.bat -PenableAe2Runtime=true runClient --console=plain
gradlew.bat test build --no-daemon --console=plain
```

## Progress Note

- Added JEI ghost ingredient support for `PatternEditorScreen` (drag ingredient into pattern slots).
- Added server sync packet for marker placement to keep client/server slots consistent.
- Kept `sampleintegration` as the runtime-compatible `modid` and resource namespace while migrating the codebase and branding to AE2 Smart Pattern System.
- Added runtime filter application in the AE2SPS pattern decode path (whitelist/blacklist now affects decoded inputs/outputs).
- Added item-marker decode cleanup so legacy `TechStartItemMarker` tags are stripped before creating AE2 item keys.
- Added offhand/main inventory sync reinforcement after saving pattern NBT in editor menu.
- Added `run-dev-safe.bat` to automate temporary runtime-jar disable/restore for dev launch stability.
For a development client:

## AE2 对齐说明 / AE2 Alignment Notes
```bat
build-dev.bat runClient --console=plain
```

- 依赖源使用 AE2 官方文档给出的坐标体系与仓库。
Dependency coordinates/repository follow AE2 official documentation.
- 当前接入版本:`appeng:appliedenergistics2-forge:15.4.10`(软依赖)。
Current integrated version: `appeng:appliedenergistics2-forge:15.4.10` (soft dependency).
- 已实现 `IPatternDetailsDecoder` + `IPatternDetails`,让 Pattern Provider 可识别 AE2SPS 样板。
Implemented `IPatternDetailsDecoder` + `IPatternDetails` so Pattern Provider can decode AE2SPS patterns.
The optional AE2 runtime is controlled by the existing
`enableAe2Runtime` Gradle property.
30 changes: 22 additions & 8 deletions versions/forge-1.20.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,39 @@ minecraft {

sourceSets.main.resources { srcDir 'src/generated/resources' }
sourceSets.main.java { srcDir '../shared/common-core/src/main/java' }
sourceSets.test.java { srcDir '../shared/common-core/src/test/java' }

repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://maven.blamejared.com' }
maven {
name = 'Modmaven'
url = 'https://modmaven.dev/'
content {
includeGroup 'appeng'
includeGroup 'mekanism'
}
}
maven {
name = 'Modrinth'
url = 'https://api.modrinth.com/maven'
content {
includeGroup 'maven.modrinth'
}
}
}

dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// AE2 1.20.1 official Forge artifact (soft integration).
compileOnly fg.deobf("appeng:appliedenergistics2-forge:${ae2_version}:api")
compileOnly fg.deobf("appeng:appliedenergistics2-forge:${ae2_version}")
compileOnly files('D:/桌面/我的世界/GTL/versions/1.20.1-Forge_47.4.10/mods/[通用机械] Mekanism-1.20.1-10.4.16.80.jar')
compileOnly files('D:/桌面/我的世界/GTL/versions/1.20.1-Forge_47.4.10/mods/[应用能源:通用机械附属] Applied-Mekanistics-1.4.3.jar')
compileOnly fg.deobf("mekanism:Mekanism:${minecraft_version}-${mekanism_version}:api")
compileOnly fg.deobf("maven.modrinth:applied-mekanistics:${applied_mekanistics_version}")
compileOnly "org.spongepowered:mixin:0.8.5"
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
// Keep AE2 runtime optional in dev runs; enable with -PenableAe2Runtime=true.
Expand All @@ -111,12 +123,10 @@ dependencies {
}
}

// Optional JEI integration: compile against a local JEI jar when available.
def jeiLocalJar = file('run/mods/jei-1.20.1-forge-15.20.0.129.jar')
def jeiDisabledJar = file('run/mods/_disabled_by_run_dev_safe/jei-1.20.1-forge-15.20.0.129.jar')
def jeiCompileJar = jeiLocalJar.exists() ? jeiLocalJar : (jeiDisabledJar.exists() ? jeiDisabledJar : null)
if (jeiCompileJar != null) {
compileOnly files(jeiCompileJar)
// Optional JEI integration uses the public developer Maven artifact.
compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge:${jei_version}")
if ((findProperty('enableJeiRuntime') ?: 'false').toString().toBoolean()) {
runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:${jei_version}")
}
}

Expand All @@ -137,6 +147,10 @@ tasks.named('processResources', ProcessResources).configure {
}
}

tasks.withType(Test).configureEach {
useJUnitPlatform()
}

tasks.named('jar', Jar).configure {
manifest {
attributes(commonManifestAttributes())
Expand Down
6 changes: 3 additions & 3 deletions versions/forge-1.20.1/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
org.gradle.jvmargs=-Xmx3G -Dfile.encoding=UTF-8
org.gradle.daemon=false
org.gradle.java.home=C:/Users/PC/AppData/Roaming/.hmcl/java/windows-x86_64/mojang-java-runtime-beta
org.gradle.java.installations.paths=C:/Users/PC/AppData/Roaming/.hmcl/java/windows-x86_64/mojang-java-runtime-beta

mod_id=sampleintegration
mod_name=AE2SPS Smart Pattern System
Expand All @@ -13,4 +11,6 @@ mod_description=Smart pattern extension for AE2SPS on AE2. Supports wildcard rec
minecraft_version=1.20.1
forge_version=47.4.10
ae2_version=15.4.10

mekanism_version=10.4.16.80
applied_mekanistics_version=1.4.3
jei_version=15.20.0.129
Loading
Loading