From e978d7f0ca9aa342b516415dc066bf8f2bd21011 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 29 Jul 2021 00:10:44 +0200 Subject: [PATCH 1/4] Hotfix DiscordRanks --- src/de/steamwar/bungeecore/bot/util/DiscordRanks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/util/DiscordRanks.java b/src/de/steamwar/bungeecore/bot/util/DiscordRanks.java index 9b976cef..dedf0a56 100644 --- a/src/de/steamwar/bungeecore/bot/util/DiscordRanks.java +++ b/src/de/steamwar/bungeecore/bot/util/DiscordRanks.java @@ -60,7 +60,7 @@ public class DiscordRanks { guild.removeRoleFromMember(member, role).complete(); } - if (!needed.isEmpty()) { + if (needed != null && !needed.isEmpty()) { guild.addRoleToMember(member, guild.getRoleById(needed)).complete(); } } From 4b7a76ae2f9fa23d6b7d0bd152ba35f84a8e2c5d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 29 Jul 2021 00:13:59 +0200 Subject: [PATCH 2/4] Hotfix BungeeCore --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 8a457e29..d6f6d947 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -157,6 +157,7 @@ public class BungeeCore extends Plugin { public void onDisable(){ ErrorLogger.stop(); SQL.close(); + SteamwarDiscordBot.instance().getJda().shutdownNow(); } public static BungeeCore get() { From 3c253eaca5a81d252d4ee8d98ad658c319ab6984 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 29 Jul 2021 00:14:28 +0200 Subject: [PATCH 3/4] Hotfix BungeeCore --- src/de/steamwar/bungeecore/bot/AuthManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/bot/AuthManager.java b/src/de/steamwar/bungeecore/bot/AuthManager.java index d574c460..e6cfa153 100644 --- a/src/de/steamwar/bungeecore/bot/AuthManager.java +++ b/src/de/steamwar/bungeecore/bot/AuthManager.java @@ -67,7 +67,11 @@ public class AuthManager { member.getUser().openPrivateChannel().complete().sendMessage(builder.build()).complete(); if(member.getNickname() == null) { - member.getGuild().modifyNickname(member, user.getUserName()).complete(); + try { + member.getGuild().modifyNickname(member, user.getUserName()).complete(); + } catch (Exception e) { + // Ignored + } } TOKENS.remove(code); return member; From 3394968b9e475ee82102b7c0f0268935768ff2ea Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 29 Jul 2021 00:18:39 +0200 Subject: [PATCH 4/4] Hotfix BungeeCore --- src/de/steamwar/bungeecore/BungeeCore.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index d6f6d947..76a9c0b9 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -31,6 +31,7 @@ import de.steamwar.bungeecore.listeners.mods.WorldDownloader; import de.steamwar.bungeecore.sql.SQL; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.Team; +import net.dv8tion.jda.api.JDA; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; @@ -158,6 +159,11 @@ public class BungeeCore extends Plugin { ErrorLogger.stop(); SQL.close(); SteamwarDiscordBot.instance().getJda().shutdownNow(); + try { + SteamwarDiscordBot.instance().getJda().awaitStatus(JDA.Status.SHUTDOWN); + } catch (Exception e) { + // Ignored + } } public static BungeeCore get() {