一键导入
eyelib-clientsmoke
Eyelib Clientsmoke 客户端烟雾测试——@ClientSmoke 注解、三层架构、运行、报告。Use when writing or running clientsmoke tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Eyelib Clientsmoke 客户端烟雾测试——@ClientSmoke 注解、三层架构、运行、报告。Use when writing or running clientsmoke tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | eyelib-clientsmoke |
| description | Eyelib Clientsmoke 客户端烟雾测试——@ClientSmoke 注解、三层架构、运行、报告。Use when writing or running clientsmoke tests. |
| license | MIT |
| compatibility | opencode |
| metadata | {"author":"https://github.com/TT432","version":"1.0.0","tags":"eyelib, testing, clientsmoke, mc","related-skills":"eyelib, eyelib-build, eyelib-debug"} |
clientsmoke 是 eyelib 的客户端烟雾测试框架——在 MC 客户端加载后、world 就绪时自动执行 @ClientSmoke 注解的测试类,输出 JSON/XML 报告。
| 层 | 环境 | 测试内容 |
|---|---|---|
| Layer 1 domain spec | 纯 JUnit (:test) | MaterialResolver, BrRenderStateFactory, Molang, CODEC |
| Layer 2a 管道 | 纯 JUnit | BrMaterialEntry → BrRenderState 语义映射 |
| Layer 2b Bridge | clientsmoke | RenderTypeResolver, RenderPassAdapter, EntityPortAdapter — 需 MC 类型 |
| Layer 3 接线 | clientsmoke + Fake | EntityRenderSystem.setupClientEntity — Component 接线 |
在 build.gradle 的 client run 配置中添加:
systemProperty 'clientsmoke.enabled', 'true'
systemProperty 'clientsmoke.autoExit', 'false' // 测试结束后保持开启
clientsmoke.enabled默认false,不加此属性状态机进入 IDLE 不执行。
测试类放在 src/main/java/io/github/tt432/eyelib/smoke/。模式:
@ClientSmoke(description = "简短描述", priority = 10)
public class MySmoke {
public MySmoke() {
// 全部逻辑在无参构造器中执行
// throw = fail, 正常返回 = pass
// 可调用 Minecraft.getInstance()、所有 Manager、所有 Bridge 类
var materials = MaterialManager.INSTANCE.getAllData();
require(!materials.isEmpty(), "No materials");
}
private static void require(boolean cond, String msg) {
if (!cond) throw new AssertionError(msg);
}
}
eyelib_debug_launch(timeout=180) # 启动 + 自动编译
# ⚠️ 不要调用 eyelib_debug_enter_world!clientsmoke 自己创建 ClientSmokeTest 世界
# 等待 ~30s → 状态机 INIT → CONFIG_LOAD → SCAN → WORLD_CREATE → STABILIZE → TEST_EXEC → REPORT
输出(gameDir = versions/<version>/run/clientsmoke,由 build.gradle clientSmoke run config 决定):
versions/<version>/run/clientsmoke/clientsmoke-reports/report-YYYYMMDD-HHmmss.jsonversions/<version>/run/clientsmoke/clientsmoke-reports/junit-YYYYMMDD-HHmmss.xmlversions/<version>/run/clientsmoke/clientsmoke-reports/screenshots/ — 每测试一张截图name:base 格式:.mcpack 中的 key 是 entity_nocull:entity 不是 entity_noculleyelib_debug_enter_world 同时使用:clientsmoke 自己创建世界,手动 enter_world 会冲突ResourceLocation 用 new ResourceLocation(ns, path):MC 1.20.1 没有 fromNamespaceAndPathEyelib 构建、测试、环境——Gradle(Stonecutter 多版本) + eyelib-debug MCP 全流程。Use when building, testing, or troubleshooting Gradle builds for the eyelib project.
Eyelib MCP 调试——启动客户端、/eval 执行代码、渲染诊断 Phase、实体操作。Use when debugging rendering, executing /eval code, or diagnosing entity issues.
Eyelib Forge 模组开发总索引——项目概览、Skill 导航、跨域约束。Load first for any eyelib task.
Extract a Port from a domain module in the hexagonal architecture refactoring — locate MC contact points, create Port interfaces, migrate glue code to bridge, and verify with ArchUnit.
Eyelib GPU 调试——RenderDoc 截帧、headless 回放、Windows Python replay、renderdoc-mcp。Use when capturing or analyzing RenderDoc frames.
Write Mixin accessors and injectors for eyelib. Use when replacing reflection with @Accessor/@Invoker, injecting into vanilla methods, or debugging Mixin AP compilation errors. Covers Forge 1.20.1 (Mixin AP active) and NeoForge 1.21.1 (no Mixin AP) dual-version patterns.