修复机器结构切换后运行中配方残留的问题#203
Open
ProperSAMA wants to merge 2 commits into
Open
Conversation
- 解决远端不存在1.4.0,无法顺利构建的问题
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
本 PR 修复一个多方块机器结构切换时,运行中配方没有被正确清理的问题。
同时将 RetroFuturaGradle 从
1.4.0更新到1.4.1,因为当前远端已无法获取1.4.0,会导致项目无法正常构建。问题描述
如果存在两个结构几乎相同的机器 A 和机器 B:
也就是说,机器结构已经从 A 切换到了 B,但旧的运行中配方上下文仍然残留。
原因
结构失效时,
resetMachine(true)会将当前机器记录到prevMachine。但同一次结构检查流程中,后续还可能调用
resetMachine(false)。此时foundMachine已经是null,导致prevMachine被覆盖成null。这样当新结构重新形成时,
onStructureFormed()无法判断机器已经从 A 切换到 B,因此没有调用resetRecipe()清理旧配方。修改内容
foundMachine == null时覆盖prevMachine;com.gtnewhorizons.retrofuturagradle从1.4.0更新到1.4.1,修复构建依赖无法下载的问题。测试