Skip to content

fix: 为 Kotlin 2 在 1.8.9 上补齐 EntityPlayerSP.getGameProfile 访问器 - #26

Merged
lmx0721 merged 13 commits into
lmx0721:mainfrom
HeypixelMinecraft:main
Jun 18, 2026
Merged

lmx0721 merged 13 commits into
lmx0721:mainfrom
HeypixelMinecraft:main

Conversation

@Sup3rS061c

Copy link
Copy Markdown
Contributor

摘要

  • 更改版本为b1.3
  • 修复 Kotlin 2 将 thePlayer.gameProfile 编译为 EntityPlayerSP.getGameProfile() 直接调用,导致 MC 1.8.9 运行时崩溃的问题
  • 在 EntityPlayerSP 注入 @Unique getGameProfile(),在 MixinEntityPlayer shadow gameProfile 字段,并通过 Access Transformer 公开该字段
  • MixinInventoryPlayer 改用 UUID 判断本地玩家,替代 GameProfile 比较

原因

Kotlin 2 会在具体类型上生成直接方法调用,而 MC 1.8.9 只在 EntityPlayer 上声明 getGameProfile(),且 gameProfile 为 private 字段。不修复会导致单人世界保存崩溃、鼠标指向实体时 IllegalAccessError。

关联提交:#c3975da(Vec3i getX/getY/getZ 访问器,同类 Kotlin 2 兼容问题)

测试计划

  • 使用新 jar 正常启动客户端
  • 进入单人世界不崩溃
  • 保存并退出世界正常
  • 鼠标指向实体时不出现 IllegalAccessError
  • SilentHotbar 切槽功能正常
  • .music gui 等客户端命令仍可正常使用

Sup3rS061c and others added 13 commits June 18, 2026 18:12
…uction jar

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
GuiChat closes the screen after sendChatMessage returns, which dismissed
the GUI immediately when opened from .music gui or on module enable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove embedded Phosphor mixins and lighting engine so users can install
Phosphor separately if desired without mixin conflicts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent GuiChat from closing the screen after client commands so the
MusicPlayer GUI is not dismissed immediately after opening.

Co-authored-by: Cursor <cursoragent@cursor.com>
Kotlin 2 compiles blockPos.x to getX(), which does not exist on MC 1.8.9
Vec3i/BlockPos and caused NoSuchMethodError during block collision ticks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Kotlin 2 emits direct getGameProfile() calls on EntityPlayerSP, which crashes at runtime; expose gameProfile via access transformer and a mixin accessor, and compare players by UUID in SilentHotbar.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lmx0721
lmx0721 merged commit e40319b into lmx0721:main Jun 18, 2026
1 check passed
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.

2 participants