Files
agentmc/README.md

32 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# mcfold — Minecraft 折叠层(净室 Python 实现)
按用户 2026-09-25 定向:**净室 Python 实现**,替代 Node/mineflayer 栈,
使产物可打包分发(无 Node 运行时依赖)。
## 架构
```
底层 mcfold(本工程,Python)
├─ 按实例文件夹读版本 → 自动选协议(P1 已完成)
├─ 声明式 protocol.json 解释器(protodef)
├─ 世界模型(chunk/方块,含 mod 注册表)
└─ 触发截屏 → 调脚手架 → 官方渲染 jar
中间 可包装为不同 agent 的插件
上层 面向 homeagent 的 Go 包装(复用现有 plugin.go 形状)
```
## 关键实测事实(决定设计)
| 事实 | 证据 |
|---|---|
| 实例文件夹 = 完整 MC 客户端安装 | `versions/<id>/<id>.json` + `.jar` |
| 加载器 id **不是**协议版本 | `minecraft-data('1.20.1-forge-47.4.0')` → FAIL,必须走 `inheritsFrom` |
| protocol.json 是**声明式**的 | `varint`/`pstring`/`mapper`/`switch` 全是数据,非代码 |
| 因此协议**不需重写**,只需解释器 | 111 个 play 包由同一份 JSON 驱动 |
| 1.20.1 **不**在网络上传递方块注册表 | codec 仅 6 类,无 block ⇒ mod 方块必须另寻途径 |
| 1.20.2+ 有 configuration 阶段 | 会发 `registry_data` ⇒ mod 方块可行的版本分界 |
## 进度
- [x] **P1** 按文件夹解析版本(`mcfold/version.py`,6 项回归全绿)