From 49cfb11bf1bce5a6ff94ca13d2d505f714f3b8ff Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 23 Feb 2023 10:51:37 +0100 Subject: [PATCH] Fix Merge Conflicts and Force Shutdown --- src/de/steamwar/bungeecore/BungeeCore.java | 5 +++++ src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java | 1 + 2 files changed, 6 insertions(+) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 4070bd72..8312327e 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -55,6 +55,7 @@ import net.md_5.bungee.config.YamlConfiguration; import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; +import java.time.Duration; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -224,6 +225,10 @@ public class BungeeCore extends Plugin { if (SteamwarDiscordBotConfig.loaded) { try { SteamwarDiscordBot.instance().getJda().shutdown(); + if(!SteamwarDiscordBot.instance().getJda().awaitShutdown(Duration.ofSeconds(10))) { + SteamwarDiscordBot.instance().getJda().shutdownNow(); + SteamwarDiscordBot.instance().getJda().awaitShutdown(); + } } catch (Throwable e) { getLogger().log(Level.SEVERE, "Could not shutdown discord bot", e); } diff --git a/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java b/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java index 20f310e7..e841456e 100644 --- a/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java +++ b/src/de/steamwar/bungeecore/bot/commands/UnbanCommand.java @@ -19,6 +19,7 @@ package de.steamwar.bungeecore.bot.commands; +import de.steamwar.bungeecore.commands.PunishmentCommand; import de.steamwar.sql.BannedUserIPs; import de.steamwar.sql.Punishment; import de.steamwar.sql.SteamwarUser;