Skip to content

Fix recipe state cleanup and enhance integration testing#64

Draft
Gu-ZT wants to merge 5 commits into
Anvil-Dev:dev/26.1from
Gu-ZT:recipe/26.1
Draft

Fix recipe state cleanup and enhance integration testing#64
Gu-ZT wants to merge 5 commits into
Anvil-Dev:dev/26.1from
Gu-ZT:recipe/26.1

Conversation

@Gu-ZT

@Gu-ZT Gu-ZT commented Jun 27, 2026

Copy link
Copy Markdown
Contributor
  • 测试命令/anvillib test recipe

Gu-ZT added 5 commits June 28, 2026 03:04
- 替换 context.getStack().clear() 为 context.clearFailedAttempt() 方法调用
- 在 InWorldRecipeContext 中新增 clearFailedAttempt() 方法实现完整的状态回滚
- 在配方管理器中添加失败尝试清理逻辑以避免状态污染
- 为 RecipeManagerMixin 添加 Nullable 注解并实现延迟初始化
- 修复 ShapelessMatcher 中的兼容性检查逻辑,确保测试失败时正确弹出已推送的谓词
- 引入 TestRecipeGenerator 类用于生成测试配方
- 注册配方数据生成器到数据生成流程
- 添加 RECIPE_TARGET 和 RECIPE_RESULT 测试方块
- 添加 RECIPE_INPUT 和 RECIPE_OUTPUT 测试物品
- 实现 RecipeIntegrationTest 类进行完整配方测试
- 在测试命令中添加 recipe 子命令用于运行测试
- 创建三个测试配方:成功、回滚和部分失败场景
- 新增ItemStack参数的spawnItem方法重载
- 添加多个spawnItem方法的JavaDoc注释
- 修复代码格式化问题
- 优化build方法中的参数传递格式
- 改进save方法中的代码结构
- 替换 player.serverLevel() 为 player.level() 方法调用
- 在InWorldRecipeBuilder中增加多个spawnItem方法重载
- 添加配方输入输出物品和目标结果方块的注册
- 实现配方成功、回滚和部分失败的测试场景
- 配置配方相关的语言文件本地化键值对
- 优化资源生成减少冗余模型文件
- 更新配方触发逻辑使用物品实例而非堆栈
@Gu-ZT Gu-ZT marked this pull request as draft June 28, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant