Simple Auto Restart

一个非常简单的Spigot插件,可以自动重启你的服务器。

资源图片
# SimpleAutoRestart [![GitHub Release](https://img.shields.io/github/v/release/teunjojo/SimpleAutoRestart?style=for-the-badge)](https://github.com/teunjojo/SimpleAutoRestart/releases) [![github](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/github_vector.svg)](https://github.com/teunjojo/SimpleAutoRestart) [![spigot](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/spigot_vector.svg)](https://www.spigotmc.org/resources/simpleautorestart.107932/) [![modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/plugin/simpleautorestart) [![curseforge](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/curseforge_vector.svg)](https://www.curseforge.com/minecraft/bukkit-plugins/simpleautorestart) [![bukkit](https://badges.penpow.dev/badges/supported/bukkit/compact.svg)](https://bukkit.org/) [![folia](https://badges.penpow.dev/badges/unsupported/folia/compact.svg)](https://papermc.io/software/folia) 我尝试了许多自动重启插件,但发现要么太复杂,要么基于周期。这意味着当 TPS 低于 20 时,它们并不准确,因此与诸如 [Hibernate](https://www.spigotmc.org/resources/hibernate.4441/) 和 [Server Naptime](https://github.com/gvk/MinecraftPluginServerHibernate) 等插件不兼容。 因此我决定自己创建一个。 [![bstats](https://bstats.org/signatures/bukkit/simpleautorestart.svg)](https://www.bstats.org/plugin/bukkit/SimpleAutoRestart/17760) ## 特性 - 安排在特定时间自动重启。 - 在重启前向玩家广播警告消息。 - 安排多个重启。 - 基于实时,而不是基于周期,因此更准确。 - 与诸如 [Hibernate](https://www.spigotmc.org/resources/hibernate.4441/) 和 [Server Naptime](https://github.com/gvk/MinecraftPluginServerHibernate) 等插件兼容。 ## 游戏内显示效果(虽然您可以自定义): ![Chat](https://i.imgur.com/ZjQq3sq.png) ## 服务器控制台显示效果(虽然您可以自定义): ![Console](https://i.imgur.com/Kshy5U5.png) ## 安装 1. 在 [spigot.yml](https://docs.papermc.io/paper/reference/spigot-configuration/#settings_restart_script) 中设置启动脚本。 2. 从发布页面下载 `SimpleAutoRestart-x.x.x-jar`。 3. 将 JAR 文件放在服务器的插件文件夹中。 4. 启动或重启服务器。 5. 通过编辑插件文件夹(plugins/SimpleAutoRestart)中的 config.yml 文件来配置插件。 ## 配置 ```yml # 服务器应该重启的小时和分钟(24 小时制) restartTime: - '00:00' # 通过添加新行来添加多个时间,例如:- '12:00' # 配置消息和相应的预警时间(秒) messages: '0': '现在重启' '1': '1秒后重启' '2': '2秒后重启' '3': '3秒后重启' '60': '1分钟后重启' '120': '2分钟后重启' '180': '3分钟后重启' '300': '5分钟后重启' titles: '300' : '§l§4警告' '3' : '§l§4警告' subtitles: '300' : "§65分钟后重启" '3' : "§6现在重启..." # 在重启时执行的命令 commands: - 'restart' ``` ## 命令 - `/simpleautorestart` 或 `/sar` 或 `/autorestart` - 显示帮助菜单。 - `/simpleautorestart cancel` - 取消下一次重启。 - `/simpleautorestart resume` - 恢复下一次重启。 - `/simpleautorestart status` - 显示下一次重启的状态。 - `/simpleautorestart set ` - 安排在特定时间重启。 ## 故障排除 ### 倒计时,但没有重启 请确保您已在 [`spigot.yml`](https://docs.papermc.io/paper/reference/spigot-configuration/#settings_restart_script) 中配置了 `restart-script`。 ## 支持 如果您遇到任何问题或疑问,请 [创建问题票证](https://github.com/teunjojo/SimpleAutoRestart/issues/new)。