RedOut 将服务器指标(如 mspt)映射到物品展示框的比较器输出。它为玩家提供了一种非侵入式的方式,在服务器卡顿严重或即将关机时关闭他们的红石装置和农场。适用于 Minecraft 1.21.11 及以上版本。
名称 RedOut 是 “Redstone”(红石)和 “read out”(读出/读取)的合成词,因为你使用 redstone(红石)来 read out(读取)服务器数值 :)
工作原理
在铁砧中将物品重命名为可用的追踪器之一,并将其放置在物品展示框中。
展示框的旋转角度(因此其比较器输出,信号强度 1–8)会自动更新。
内置追踪器:
| 物品名称 |
指标 |
mspt |
默认每级红石信号对应 10ms |
daily restart |
距离下次关机的倒计时(每日或一次性)。默认每级红石信号对应 1m。 |
命令
所有子命令都需要下方列出的相应权限。
/redout reload
重新加载 config.yml 而无需重启服务器。
/redout status
显示一次性关机倒计时(如果已安排)以及每日重启时间和倒计时。
/redout trackers list <#all|trackerId>
列出特定追踪器或所有追踪器当前加载的物品展示框追踪器。
输出包括世界名称和方块坐标。未加载区块中的展示框不会显示。
/redout schedule shutdown set <time> [--force]
计划一次性的服务器关机。RedOut 将运行配置好的关机前命令,然后调用关机。
不会在重启后保留。
/redout schedule shutdown unset
取消当前的一次性关机计划。
/redout schedule shutdown status
显示距离下次关机(一次性或每日)的剩余时间。
/redout schedule shutdown daily <HH:mm|disable>
更新 config.yml 中的每日重启时间。使用 disable 可完全关闭每日重启功能。该追踪器对于一次性关机仍会按预期工作。
set 接受的格式:
| 格式 |
示例 |
含义 |
Ns |
90s |
从现在起 N 秒 |
Nm |
10m |
从现在起 N 分钟 |
Nh |
2h |
从现在起 N 小时 |
HH:mm |
23:00 |
时钟时间(下一次发生的时间) |
HH:mm:ss |
23:00:00 |
带秒数的时钟时间 |
允许的最小时间 = max(signal-interval-seconds × 8, 最大的关机前命令键)。
使用 --force 可绕过最小值限制。设置最小值的目的是确保在关机前信号能达到 8,给玩家反应并关闭他们装置的机会。
权限
| 权限 |
默认值 |
描述 |
redout.reload |
op |
/redout reload |
redout.status |
op |
/redout status |
redout.trackers |
op |
/redout trackers list |
redout.schedule |
op |
/redout schedule shutdown * |
配置
config.yml 会在首次运行时自动创建。
| 键名 |
默认值 |
描述 |
update-interval-ticks |
20 |
展示框更新的频率(以刻为单位)。20 = 1 秒。 |
signal-interval-seconds |
60 |
daily restart 追踪器每个比较器信号步长的秒数。 |
trackers.mspt.max-value |
50.0 |
映射到信号 8 的 MSPT 值。 |
trackers.daily restart.time |
03:00 |
每日重启时间(24 小时制 HH:mm,服务器本地时间)。设置为 "disabled" 可禁用每日倒计时。 |
shutdown-commands |
见下文 |
一次性关机前运行的命令。键为距离关机的时间偏移量。 |
daily-restart-commands |
见下文 |
每日重启时间前运行的命令。RedOut 不会发出关机指令。 |
命令值中的 %player% 会导致该命令针对每个在线玩家执行一次,并将玩家名称代入。
config.yml 示例:
update-interval-ticks: 20
signal-interval-seconds: 60
trackers:
mspt:
max-value: 50.0
daily restart:
time: "03:00"
shutdown-commands:
5m: "say Server shutting down in 5 minutes!"
1m: "say Server shutting down in 1 minute!"
10s: "kick %player% Server is shutting down for maintenance."
daily-restart-commands:
5m: "say Daily restart in 5 minutes!"
1m: "say Daily restart in 1 minute!"
RedOut maps server metrics like mspt to item frame comparator outputs. Giving a non-invasive way to players to shut off their redstone contraptions and farms when the server gets too laggy or before shutdown. Made for Minecraft 1.21.11 and above.
The name RedOut is a portmanteau of "Redstone" and "read out" because you read out server values with redstone :)
How it works
Rename an item in an anvil to one of the trackers available and place it in an item frame.
The frame's rotation (and therefore its comparator output, signals 1–8) will update automatically.
Built-in trackers:
| Item name |
Metric |
mspt |
By default 10ms per redstone level |
daily restart |
Countdown to next shutdown (daily or one-time). By default 1m per redstone level. |
Commands
All subcommands require the matching permission listed below.
/redout reload
Reloads config.yml without restarting the server.
/redout status
Shows one-time shutdown countdown (if scheduled) and daily restart time with countdown.
/redout trackers list <#all|trackerId>
Lists all currently loaded tracked item frames for a specific tracker or all trackers.
Output includes world name and block coordinates. Frames in unloaded chunks are not shown.
/redout schedule shutdown set <time> [--force]
Schedules a one-time server shutdown. RedOut will run the configured pre-shutdown commands and then call shutdown.
Do not persist trough restarts.
/redout schedule shutdown unset
Cancels the current one-time shutdown schedule.
/redout schedule shutdown status
Shows time remaining until the next shutdown (one-time or daily).
/redout schedule shutdown daily <HH:mm|disable>
Updates the daily restart time in config.yml. Use disable to turn off the daily restart entirely. The tracker will still function as expected for one-time shutdowns.
Accepted time formats for set:
| Format |
Example |
Meaning |
Ns |
90s |
N seconds from now |
Nm |
10m |
N minutes from now |
Nh |
2h |
N hours from now |
HH:mm |
23:00 |
Wall-clock time (next occurrence) |
HH:mm:ss |
23:00:00 |
Wall-clock time with seconds |
Minimum allowed time = max(signal-interval-seconds × 8, largest pre-shutdown command key).
Use --force to bypass the minimum. The minimum exists to ensure that the shutdown signal can reach 8 before shutdown, giving players a chance to react and shut off their contraptions.
Permissions
| Permission |
Default |
Description |
redout.reload |
op |
/redout reload |
redout.status |
op |
/redout status |
redout.trackers |
op |
/redout trackers list |
redout.schedule |
op |
/redout schedule shutdown * |
Configuration
config.yml is created automatically on first run.
| Key |
Default |
Description |
update-interval-ticks |
20 |
How often frames are updated (ticks). 20 = 1 s. |
signal-interval-seconds |
60 |
Seconds per comparator signal step for the daily restart tracker. |
trackers.mspt.max-value |
50.0 |
MSPT value that maps to signal 8. |
trackers.daily restart.time |
03:00 |
Daily restart time (24-hour HH:mm, server local time). Set to "disabled" to disable the daily countdown. |
shutdown-commands |
see below |
Commands run before a one-time shutdown. Keys are time offsets before shutdown. |
daily-restart-commands |
see below |
Commands run before the daily restart time. No shutdown is issued by RedOut. |
%player% in a command value causes it to run once per online player with the player name substituted.
Example config.yml:
update-interval-ticks: 20
signal-interval-seconds: 60
trackers:
mspt:
max-value: 50.0
daily restart:
time: "03:00"
shutdown-commands:
5m: "say Server shutting down in 5 minutes!"
1m: "say Server shutting down in 1 minute!"
10s: "kick %player% Server is shutting down for maintenance."
daily-restart-commands:
5m: "say Daily restart in 5 minutes!"
1m: "say Daily restart in 1 minute!"
评论 0
登录后参与评分
还没有评论,来抢沙发吧