Tick freeze#1215
Open
balugaq wants to merge 6 commits into
Open
Conversation
Member
|
@codex review pr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd0fd07c30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Author
|
Done. |
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 添加了
/sf tick指令,旨在方便地对粘液刻运行打断点,便于调试机器时序运行测试bug等。命令基础:
/sf tick一、无额外参数
/sf tick功能:切换全局 Tick 冻结模式(开启 ↔ 关闭)
效果:发送 messages.tick-mode,显示当前是“开启”还是“关闭”
二、两个参数(/sf tick <参数>)
/sf tick show功能:显示当前正在等待 Tick 的物品列表
/sf tick freeze功能:开启全局 Tick 冻结(所有机器停止工作)
/sf tick unfreeze功能:关闭全局 Tick 冻结(恢复正常)
/sf tick query功能:查询当前 Tick 冻结状态和 Tick 速率(isTickFreeze + getTickRate)
/sf tick at功能:仅玩家可用。冻结玩家准星指向的方块(距离 ≤ 8 格)或主手持有的 Slimefun 物品。若目标既不是机器也不是物品,则提示 not-found
/sf tick <SlimefunItemID>功能:冻结指定 ID 的 Slimefun 物品(如 BASIC_CIRCUIT_BOARD)。ID 自动转为大写匹配
三、三个参数(速率设置)
/sf tick rate <数字>功能:设置 Tick 的执行间隔(单位:游戏刻,20 tick = 1 秒)
示例:/sf tick rate 10 → 每 10 tick 执行一次
异常:若 <数字> 非整数,提示 not-a-number
四、坐标参数(冻结指定位置的方块)
/sf tick <x> <y> <z>世界取当前发送者所在的世界(控制台默认为 "world")
/sf tick <世界名> <x> <y> <z>示例:/sf tick world_nether 100 64 -200
功能:仅冻结该坐标方块的 Tick
帮助信息:
当参数模式无法匹配上述任何一条时,发送 messages.usage,提示:
/sf tick (<x> <y> <z> | <Slimefun Item>)无权限提示:
若玩家没有权限且不是控制台,发送 messages.no-permission
在启动 Tick 冻结(
/sf tick freeze)后,管理员可以使用/sf tick show查看当前被阻塞的 Slimefun 机器/物品等待列表,并针对列表中的条目进行逐步执行、跳转执行或位置高亮等调试操作。本功能(showWaitingList)的行为描述如下:
分页显示等待队列
每个条目提供三种可点击的操作(悬浮提示):
操作执行逻辑
权限与接收者
使用场景:当全局 Tick 冻结后,管理员可以通过该命令观察仍有待处理任务的机器队列,并有选择地逐步执行某些机器的 Tick 任务,便于排查问题或手动推进流程。