ZRestart
专为 Minecraft Java 26.x 设计的轻量级 Paper 专用自动重启调度器。
ZRestart 调度原生的 Bukkit.restart() 调用,通过聊天、标题、Boss 栏和声音广播可配置的重启倒计时警告,并为管理员提供完全的手动控制权——所有面向玩家、管理员和控制台的消息均在 messages.yml 中暴露。该插件专为 Paper 26.x 和 Java 25+ 构建,不携带任何旧版本的兼容包袱。
为什么选择 ZRestart
- 优先适配 Paper 26.x。 不为旧 API 版本提供兼容性补丁。代码库精简,直接针对当前 Paper API 进行优化。
- 熟悉的调度格式。 使用
DAY;HOUR;MINUTE[;REASON] 格式的条目,任何经验丰富的管理员一眼就能识别。
- 真实的时区处理。 支持 IANA 时区 ID,具备正确的夏令时(DST)间隙/重叠行为处理,并支持可配置的备用时区。
- 原子化重载。 损坏的配置绝不会导致插件崩溃——如果重载失败,ZRestart 会保留上一个有效的运行时配置。
- 带自动迁移的版本化配置。 在插件更新时添加新键,保留您的自定义设置,并在任何重写之前保存带时间戳的备份。
- 重启脚本诊断。 在启动时检测不安全的
Bukkit.restart() 设置并发出警告,防止“重启”无声地变成“停止”。
- 公开只读 API 供其他插件查询重启状态并以编程方式触发开始/停止。
功能
⏱️ 调度
- 使用每日或工作日条目(
DAY;HOUR;MINUTE[;REASON])自动调度重启
- 手动重启倒计时:
/zrestart now <interval> [reason]
- 实时延迟与取消:
/zrestart delay <interval> 和 /zrestart stop
- 灵活的间隔格式:
30m、1:30、3600、1h 30m 等
? 警告
- 四个通道:聊天、标题、Boss 栏、声音——均由同一个共享警告列表驱动
- 每个警告项包含可配置的声音名称、类别、音量和音调
- Boss 栏支持可配置的颜色、叠加层、进度和
show-from 阈值
- 当计划了手动重启或取消了待处理的重启时,显示玩家标题弹窗
⚙️ 配置与可靠性
- 完整支持 MiniMessage 以及传统的
& 颜色代码
- 可配置时区,具备夏令时间隙/重叠处理和备用时区
- 版本化的
config.yml 和 messages.yml,支持自动模式迁移
- 在任何自动更新重写之前保存带时间戳的备份(
config.yml.bak-YYYYMMDD-HHMMSS)
- 原子化重载——如果重载失败,保留上一个有效的运行时配置
- 启动时诊断不安全的
Bukkit.restart() 设置
- 子命令、间隔时间和已配置原因的支持 Tab 补全
- 覆盖解析器、调度器、警告和重载路径的单元测试
? 集成
- 公开只读 API,暴露手动和自动重启状态以及开始/停止触发器
- 可选的重启前控制台命令,支持
CONTINUE 或 ABORT 失败行为
- 可选的 PlaceholderAPI 集成,用于绑定到玩家的消息
- 在重启前尝试保存玩家数据和世界数据
使用场景
- 在固定时间表上执行每日或每周的自动化维护重启
- 为热修复、插件重载或紧急维护执行一次性手动重启
- 使用共享时区配置在网络范围内同步重启
- 在每次重启前运行重启前命令(备份、save-all、广播、踢人、Webhook 触发)
- 通过聊天、标题、Boss 栏和声音的任何组合显示倒计时警告
重启前命令——灵活设计
ZRestart 不会硬编码如踢出玩家或跳过空服务器等行为。重启前命令部分允许您在重启触发之前按顺序运行任何控制台命令:
pre-restart-commands:
enabled: true
failure-behavior: CONTINUE
commands:
- "save-all"
- "kick @a Server restarting"
- "broadcast See you in 30 seconds!"
将 failure-behavior 设置为 ABORT,以便在任何命令失败时取消重启。
命令
| 命令 |
描述 |
权限 |
/zrestart |
显示帮助信息 |
zrestart.time |
/zrestart time |
显示当前活动或下次计划的重启状态 |
zrestart.time |
/zrestart now <interval> [reason] |
启动手动重启倒计时 |
zrestart.admin |
/zrestart delay <interval> |
延迟当前活动的倒计时 |
zrestart.admin |
/zrestart stop |
取消当前活动的倒计时 |
zrestart.admin |
/zrestart reload |
重新加载 config.yml 和 messages.yml |
zrestart.reload |
权限
| 节点 |
默认值 |
允许操作 |
zrestart.time |
true |
/zrestart 和 /zrestart time |
zrestart.admin |
op |
手动立即 / 延迟 / 停止 |
zrestart.reload |
op |
配置和消息重载 |
要求
- Paper 26.1.2+
- Java 25+
- (可选) PlaceholderAPI 2.12.2+ 用于玩家绑定消息中的占位符支持
安装
- 将
ZRestart.jar 放入服务器的 plugins/ 文件夹。
- 启动服务器一次,以生成
config.yml 和 messages.yml。
- 确认
spigot.yml 中包含有效的 settings.restart-script。
- 编辑
plugins/ZRestart/config.yml 以设置调度、通道、时区和重启前命令。
- 编辑
plugins/ZRestart/messages.yml 以修改所有面向用户的文本。
- 配置文件更改后,运行
/zrestart reload。
范围
ZRestart 有意专注于特定功能。它不支持:
- Spigot、Folia、Velocity、BungeeCord 或任何代理软件
- 低于 26.x 的 Minecraft 版本
- ZRestart 专用的 PlaceholderAPI 扩展(它消费占位符,但不暴露自己的占位符)
- 硬编码的玩家踢出或跳过空服务器逻辑——这些通过重启前命令灵活处理
Bukkit.restart() 需要在 spigot.yml 中正确配置 settings.restart-script。如果检测到配置不当,ZRestart 将在启动时发出警告。
链接与支持
- 源代码:
- 问题追踪器:
- BuiltByBit:
- 作者网站:
由 Zenologia 构建并维护。
ZRestart
Lightweight Paper-only auto-restart scheduler for Minecraft Java 26.x.
ZRestart schedules native Bukkit.restart() calls, broadcasts configurable countdown warnings across chat, title, boss bar, and sound, and gives admins full manual control — with every player, admin, and console-facing message exposed in messages.yml. Built specifically for Paper 26.x and Java 25+, with no legacy version baggage.
Why ZRestart
- Paper 26.x-first. No compatibility shims for old API versions. Lean codebase targeting the current Paper API directly.
- Familiar schedule format. Uses
DAY;HOUR;MINUTE[;REASON] entries that any experienced admin will recognize on sight.
- Real timezone handling. IANA timezone IDs with proper DST gap/overlap behavior and a configurable fallback timezone.
- Atomic reload. A broken config never breaks the plugin — ZRestart keeps the previous valid runtime if a reload fails.
- Versioned configs with automatic migration. Adds new keys on plugin updates, preserves your customizations, and saves timestamped backups before any rewrite.
- Restart-script diagnostic. Detects unsafe
Bukkit.restart() setups on startup and warns you, so a "restart" doesn't silently become a "stop."
- Public read-only API for other plugins to query restart state and trigger start/stop programmatically.
Features
⏱️ Scheduling
- Automatic restart scheduling using
Daily or weekday entries (DAY;HOUR;MINUTE[;REASON])
- Manual restart countdowns:
/zrestart now <interval> [reason]
- Live delay and cancel:
/zrestart delay <interval> and /zrestart stop
- Flexible interval formats:
30m, 1:30, 3600, 1h 30m, and more
? Warnings
- Four channels: chat, title, boss bar, sound — all driven from one shared warning list
- Per-warning sound entries with configurable sound name, category, volume, pitch
- Boss bar with configurable color, overlay, progress, and
show-from threshold
- Player title popups when manual restarts are scheduled or pending restarts are cancelled
⚙️ Configuration & reliability
- Full MiniMessage support alongside legacy
& color codes
- Configurable timezone with DST gap/overlap handling and fallback timezone
- Versioned
config.yml and messages.yml with automatic schema migration
- Timestamped backups before any auto-update rewrite (
config.yml.bak-YYYYMMDD-HHMMSS)
- Atomic reload — keeps the previous valid runtime config if a reload fails
- Startup diagnostic for unsafe
Bukkit.restart() setups
- Tab-completion for subcommands, intervals, and configured reasons
- Unit tests covering parser, scheduler, warnings, and reload paths
? Integration
- Public read-only API exposing manual + automatic restart state and start/stop triggers
- Optional pre-restart console commands with
CONTINUE or ABORT failure behavior
- Soft PlaceholderAPI integration for player-bound messages
- Attempts player and world saves before restart
Use cases
- Daily or weekly automated maintenance restarts on a fixed schedule
- One-off manual restarts for hotfixes, plugin reloads, or emergency maintenance
- Network-wide synchronized restarts using a shared timezone configuration
- Running pre-restart commands (backups, save-all, broadcasts, kicks, webhook triggers) before every restart
- Showing countdown warnings through any combination of chat, title, boss bar, and sound
Pre-restart commands — flexible by design
ZRestart doesn't hardcode behaviors like kicking players or skipping empty restarts. The pre-restart commands section lets you run any console commands in sequence before the restart fires:
pre-restart-commands:
enabled: true
failure-behavior: CONTINUE
commands:
- "save-all"
- "kick @a Server restarting"
- "broadcast See you in 30 seconds!"
Set failure-behavior: ABORT to cancel the restart if any command fails.
Commands
| Command |
Description |
Permission |
/zrestart |
Show help |
zrestart.time |
/zrestart time |
Show active or next scheduled restart status |
zrestart.time |
/zrestart now <interval> [reason] |
Start a manual restart countdown |
zrestart.admin |
/zrestart delay <interval> |
Delay the active countdown |
zrestart.admin |
/zrestart stop |
Cancel the active countdown |
zrestart.admin |
/zrestart reload |
Reload config.yml and messages.yml |
zrestart.reload |
Permissions
| Node |
Default |
Allows |
zrestart.time |
true |
/zrestart and /zrestart time |
zrestart.admin |
op |
Manual now / delay / stop |
zrestart.reload |
op |
Config and message reload |
Requirements
- Paper 26.1.2+
- Java 25+
- (Optional) PlaceholderAPI 2.12.2+ for placeholder support in player-bound messages
Installation
- Drop
ZRestart.jar into your server's plugins/ folder.
- Start the server once so
config.yml and messages.yml generate.
- Confirm
spigot.yml has a valid settings.restart-script.
- Edit
plugins/ZRestart/config.yml for schedules, channels, timezone, and pre-restart commands.
- Edit
plugins/ZRestart/messages.yml for all user-facing text.
- Run
/zrestart reload after config changes.
Scope
ZRestart is intentionally focused. It does not support:
- Spigot, Folia, Velocity, BungeeCord, or any proxy software
- Minecraft versions older than 26.x
- A ZRestart PlaceholderAPI expansion (it consumes placeholders, doesn't expose its own)
- Hardcoded player-kick or skip-empty-server logic — handled flexibly through pre-restart commands instead
Bukkit.restart() requires a properly configured settings.restart-script in spigot.yml. ZRestart will warn you on startup if this looks misconfigured.
Links & support
- Source code:
- Issue tracker:
- BuiltByBit:
- Author site:
Built and maintained by Zenologia.
评论 0
登录后参与评分
还没有评论,来抢沙发吧