
You are viewing a potentially older version of this package. View Latest Version
EasyCraft
[AI-generated] Load 5 items per interaction into smelters/refineries, refuel torches/bonfires/hearths, auto-pull missing items from nearby chests. Campfire keeps vanilla 1-per-press but chest-fed. Client-only.EasyCraft
AI 生成声明:本模组由 AI 智能体(WorkBuddy)在用户的明确需求与逐项验收下编写; 功能设计、真机测试与发布决定均由用户主导。
炼制站点 / 火源的装填增强。 由 EasyBatchFill 与 EasyNearbyFill 合并而成 —— 合并同时消掉了原先两者之间那条「必须成对升级、单升一边 BepInEx 直接加载失败」的跨程序集硬依赖。
功能
- 批量装填:一次交互装入
BatchSize个(默认 5),取代原版的一次 1 个。 站点:熔炉 / 高炉 / 炭窑 / 风车 / 纺车 / Eitr 精炼厂。 - 火源加燃料:火炬 / 壁灯 / 篝火 / 火盆 / 灶 一次加
BatchSize个; 营火(fire_pit)默认走「一次一个」名单:数量保持原版 1 个, 但仍然会从附近箱子自动取木头 —— 做饭的基础火一次烧 5 个木头太快。 - 就近取料:背包料不够时,从半径 30 米内的箱子自动补足。 默认只认木箱 + 强化箱;私人箱与宝藏箱有意排除。
- 占用保护:队友站在箱子旁就跳过它,避免抢走所有权导致对方物品回弹。
配置(5 节)
| 节 | 内容 |
|---|---|
1 - Batch Fill |
Enabled / BatchSize |
2 - Fire Sources |
Enabled / Exclude / Sources(留空 = 全部火源生效)/ OneAtATime / HoldInterval / RespectToggle |
3 - Nearby Chests |
Enabled / Radius / AllowedContainers / RespectWards / ClaimOwnership |
4 - Safety |
SkipInUse / SkipIfPlayerNear / PlayerNearDistance |
5 - Debug |
DebugLogging |
BepInEx/config/easycraft.client.only.cfg ⚠️ 改完必须重启游戏。
三张火源名单叠加后的语义(1.0.1 起)
| Exclude | OneAtATime | 行为 |
|---|---|---|
| ✅ 命中 | ❌ 不在 | 完全交回原版(一次 1 个、也不从箱子取料) |
| ✅ 命中 | ✅ 在 | 数量固定 1 个,但料源(附近箱子)可用 ← 营火默认 |
| ❌ 未命中 | — | 正常接管,一次装 BatchSize 个 |
想给别的火源也用「一次一个 + 拉料」,把它的 GameObject 名同时加进 Exclude 和 OneAtATime。
⚠️ 填火源名字前先看这里
Exclude / Sources 里填的是 GameObject 名,它不一定等于本地化键:
| 官方中文 | GameObject 名 | 容易误写 |
|---|---|---|
| 营火(能做饭的基础火) | fire_pit |
piece_firepit |
| 篝火 | bonfire |
piece_bonfire |
| 灶 | hearth |
piece_hearth |
| 壁灯 | piece_dvergr_lantern |
— |
| 火炬 | piece_groundtorch / piece_groundtorchwood … |
— |
不确定某个火源到底叫什么,看日志里的 [火源探测] 行 ——
它会把「组件在=…」和「ZDO名=…」都打出来。
实现要点
- 站点装填:
Smelter.OnAddOre/OnAddFuel的 prefix;火源:Fireplace.Interact的 prefix。 - 料源:
Container.Awake/OnDestroyed维护活箱子登记表,搜索时以【机器】和【玩家】各自为圆心。 取料顺序:先吃背包 → 按距离更近优先逐个箱子取 → 取够即停。 - 取料前用
ZNetView.ClaimOwnership()接管箱子 ZDO 所有权 —— 必须, 否则Container.OnContainerChanged()的if (!IsOwner()) return;会让改动不被保存,产生复制。 - 🔴 Harmony prefix 铁律:处理不了就
return true完整交回原版,绝不静默return false—— 那会表现为「按 E 完全没反应」,极难排查。
联机
纯客户端。 主机、其他玩家都不需要装。
不声明 NetworkCompatibilityAttribute,不引用 Jotunn,不内嵌 ServerSync / CCS。

