Skip to content

fix(replay): 进入回放前先退出当前世界或服务器 - #6

Merged
cursor[bot] merged 4 commits into
masterfrom
cursor/replay-leave-world-5de2
Aug 29, 2026
Merged

cursor[bot] merged 4 commits into
masterfrom
cursor/replay-leave-world-5de2

Conversation

@gaoyu06

@gaoyu06 gaoyu06 commented Aug 29, 2026

Copy link
Copy Markdown
Member

在世界或服务器里点播放时,ReplayPlayback.open() 会直接建 IsolatedSession,不会断开当前连接。旁观/镜头移动仍走原来的 mc.connection,表现为飞行等异常。

改动

ReplayPlayback.open() 在创建 isolated listener 之前先 leaveCurrentSession():

  • 有 level / player / connection 时走现有 Shortcut 同款断开:mc.disconnect(当前屏幕, false)(1.20.5+),更早版本 clearLevel
  • 不中间弹出多人游戏/主菜单,保留当前回放界面
  • rebuild()(后退 seek)也会再走 open(),此时现世已卸掉,方法是空操作或只清残留回放世界

验证

  • 单人世界里打开回放:应退出该世界,不再向它发包
  • 多人服务器里打开回放:应断开服务器,移动不再发到原服
  • 主菜单打开回放:行为不变
  • 回放中后退 seek / 重开:不误伤、不闪菜单
  • 本环境无法启动 Minecraft 客户端,未做游戏内实测

范围

只改 Nova 回放进入路径。Edge 同问题见 FPSMaster-Edge#187。

Open in Web Open in Cursor 

cursoragent and others added 4 commits August 29, 2026 04:06
在已连接世界或服务器时打开回放会留下原通道继续发包。
playback.open 先断开现世/服务器,再创建 isolated listener。

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
1.21.11 / 26.2 的 Minecraft.disconnect 参数是 Screen 而非 Screen?。
回放 seek 重建时当前连接已是 EmbeddedChannel,不能再当现世断开。

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
各版本 Yarn 里 channel 都是 Channel 属性,channel() 会被当成对 Channel 做 invoke。

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
channel 在各版本都是私有字段。现世只在第一次 open 时断开,
seek 重建只重建 isolated session,不再走 disconnect。

Co-authored-by: Gao Yu <gaoyu06@users.noreply.github.com>
@cursor
cursor Bot merged commit e4f668b into master Aug 29, 2026
8 checks passed
@gaoyu06
gaoyu06 deleted the cursor/replay-leave-world-5de2 branch October 24, 2026 13:05
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