feat: 仓鼠球链接Redis失败时关闭服务器

This commit is contained in:
2024-03-08 10:00:36 +08:00
parent 41ea7ade9c
commit ea0c3e005b
3 changed files with 7 additions and 1 deletions

View File

@@ -56,7 +56,11 @@ public class HamsterBallPlugin extends JavaPlugin {
try {
BallBukkitAPI.getInstance().enable();
} catch (Exception e) {
getLogger().info("仓鼠球启动失败,原因:" + e.getMessage());
e.printStackTrace();
getLogger().info("由于仓鼠球启动失败,服务器将立即关闭");
Bukkit.shutdown();
return;
}
Bukkit.getPluginManager().registerEvents(BallBukkitListener.INSTANCE, this);
BallAPI.getInstance().getEventBus().register(BallBukkitListener.INSTANCE);