MicroTimingReplay (MTIR)
在 README.md 中阅读更多内容
一款用于 Fabric 的模组,可在一段时间内记录服务器上的微时序事件(方块更新、形状更新、计划刻、方块事件、活塞移动、实体移动/生成等),并在之后逐步回放这些事件——你可以向前或向后移动,跳转到任意步骤,并检查每个事件产生时的 Java 调用栈。
核心概念
配置档案 (Profile)
一个录制会话的容器。每个配置档案拥有自己的名称、一个或多个区域 (Areas)、所有已录制的刻帧,以及关联的世界备份和调用栈文件。
区域 (Area)
一个轴对齐包围盒 + 其所属维度。只有落在区域内的才会被记录。一个配置档案可以包含多个区域,并且可以跨越多个维度。
如果配置档案没有任何区域,则不应用空间过滤(整个世界的每个事件都会被记录)——数据量会变得极其庞大;不建议这样做。
帧 / 事件 / 步骤
录制按游戏刻(TickFrame)切分为帧。在每个帧内部是一个事件树:
阶段 → 队列 → 更新 → 叶子事件(添加计划刻 / 实体移动 / ...)
快速入门
/tick freeze
/mtr profile create test
/mtr profile area add test 100 60 100 120 80 120
/mtr record test 20
录制将在 20 个 gt 后自动停止(你也可以使用 /mtr record stop 手动停止)。
/mtr replay start test
/mtr replay forward steps 1
/mtr replay screen
/mtr replay stop
注意事项
- 请在录制前运行
/tick freeze。 该模组不会自行冻结或解冻时间。回放不受影响;即使没有冻结时间,逐步操作也能正常工作。
- 回放会真正修改世界。
replay start 会将区域恢复到录制开始时的状态;replay stop 会将你的实时世界恢复。如果在回放期间服务器崩溃或被强制终止,_replay 备份不会自动恢复,你的世界将保持在录制开始时的状态——在这种情况下,只需再次运行 /mtr replay start,然后正常执行 stop 即可恢复。
- 区域内的非玩家实体会被备份和恢复。 在恢复时,区域内的实体首先会被清除,然后从备份中重建。
- 无区域 = 无过滤。 没有任何区域的配置档案会记录整个世界中的每个事件;请谨慎使用。
subscribe、unsubscribe、screen 和 dump 必须由玩家执行(它们要么为玩家打开用户界面,要么绑定到玩家)。其他所有命令可以从控制台或命令方块中运行。
/mtr profile info 的“当前查看”状态是一个全局单变量;多名玩家同时操作会相互干扰。
MicroTimingReplay (MTIR)
Read more in README.md
A Fabric mod for recording micro-timing events on the server over a period of time (block updates, shape updates, scheduled ticks, block events, piston movements, entity movement/spawning, etc.) and later step-by-step replaying them — you can go forward, backward, jump to any step, and inspect the Java call stack at the moment each event was produced.
Core Concepts
Profile
A container for one recording session. Each profile has its own name, one or more Areas, all recorded tick frames, plus associated world backups and call-stack files.
Area
An axis-aligned bounding box + the dimension it belongs to. Only events that fall inside an area are recorded. A profile can have multiple areas and can span dimensions.
If a profile has no areas at all, no spatial filtering is applied (every event in the entire world is recorded) — the data volume becomes enormous; this is not recommended.
Frame / Event / Step
Recording is sliced into frames by game tick (TickFrame). Inside each frame is an event tree:
Phase → Queue → Update → Leaf events (add scheduled tick / entity move / ...)
Quick Start
/tick freeze
/mtr profile create test
/mtr profile area add test 100 60 100 120 80 120
/mtr record test 20
Recording stops automatically after 20 gt (or you can stop it manually with /mtr record stop).
/mtr replay start test
/mtr replay forward steps 1
/mtr replay screen
/mtr replay stop
Notes
- Run
/tick freeze before recording. The mod never freezes or unfreezes time by itself. Replay is unaffected; stepping works correctly even without freezing.
- Replay truly modifies the world.
replay start restores the areas to the recording start state; replay stop restores your live world. If the server crashes or is force-killed during replay, the _replay backup is not restored automatically and your world stays at the recording-start state — in that case simply run /mtr replay start again and then a normal stop to recover.
- Non-player entities inside the areas are backed up and restored. On restore the entities inside the areas are first cleared, then rebuilt from the backup.
- No areas = no filtering. A profile without any areas records every event in the whole world; use with caution.
subscribe, unsubscribe, screen and dump must be executed by a player (they either open a UI for the player or bind to a player). All other commands can be run from the console or command blocks.
- The “currently viewed” state of
/mtr profile info is a single server-wide variable; simultaneous operations by multiple players will interfere with each other.
评论 0
登录后参与评分
还没有评论,来抢沙发吧