fix: 在开发运行环境中禁用 Mixin RefMap - #60
Open
FuBangkun wants to merge 1 commit into
Open
Conversation
Author
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.
问题背景
在开发环境下本地运行(
runClient/runServer)时,compileJava阶段的注解处理器会生成包含 SRG 映射的refmap.json并打包进编译资源。Cleanroom / CleanMix 在运行时会加载该 RefMap,导致 Mixin 误将 MCP 名称重映射为 SRG 名称(func_xxx/field_xxx),从而触发InvalidAccessorException异常。解决方案
在
build.gradle的mcpForge.runs.configureEach配置块中添加systemProperty 'mixin.env.disableRefMap', 'true'。这会让 Mixin 在本地调试运行时自动忽略 RefMap 映射,同时不影响生产环境打 JAR 包时正常生成 RefMap。变更说明
build.gradle:在mcpForge.runs.configureEach内新增系统属性systemProperty 'mixin.env.disableRefMap', 'true'。