From 4a6f3df78304dcdc15599ec550606f1793ff1b49 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 2 Aug 2018 21:04:42 +0200 Subject: [PATCH 1/2] Fix concurrent mod. on start A week old change --- .idea/compiler.xml | 5 +++++ .../Maven__net_md_5_bungeecord_chat_1_12_SNAPSHOT.xml | 6 +++--- ...__org_spigotmc_spigot_api_1_12_2_R0_1_SNAPSHOT.xml | 6 +++--- .../src/main/java/buttondevteam/lib/TBMCCoreAPI.java | 11 +++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 9e65dc8..ba952b2 100755 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -20,4 +20,9 @@ + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_12_SNAPSHOT.xml b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_12_SNAPSHOT.xml index 8ae748d..a472890 100644 --- a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_12_SNAPSHOT.xml +++ b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_12_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_12_2_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_12_2_R0_1_SNAPSHOT.xml index 8cc2f18..42f0d6f 100644 --- a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_12_2_R0_1_SNAPSHOT.xml +++ b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_12_2_R0_1_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + \ No newline at end of file diff --git a/ButtonCore/src/main/java/buttondevteam/lib/TBMCCoreAPI.java b/ButtonCore/src/main/java/buttondevteam/lib/TBMCCoreAPI.java index 9f0539f..76498d5 100755 --- a/ButtonCore/src/main/java/buttondevteam/lib/TBMCCoreAPI.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/TBMCCoreAPI.java @@ -16,6 +16,7 @@ import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map.Entry; @@ -154,11 +155,12 @@ public class TBMCCoreAPI { exceptionsToSend.clear(); // Don't call more and more events if all the handler plugins are unloaded Bukkit.getLogger().warning("Unhandled exception list is over 20! Clearing!"); } - for (Entry entry : exceptionsToSend.entrySet()) { + for (Iterator> iterator = exceptionsToSend.entrySet().iterator(); iterator.hasNext(); ) { + Entry entry = iterator.next(); TBMCExceptionEvent event = new TBMCExceptionEvent(entry.getKey(), entry.getValue()); Bukkit.getPluginManager().callEvent(event); if (event.isHandled()) - exceptionsToSend.remove(entry.getKey()); + iterator.remove(); } } } @@ -169,11 +171,12 @@ public class TBMCCoreAPI { debugMessagesToSend.clear(); // Don't call more and more DebugMessages if all the handler plugins are unloaded Bukkit.getLogger().warning("Unhandled Debug Message list is over 20! Clearing!"); } - for (String message : debugMessagesToSend) { + for (Iterator iterator = debugMessagesToSend.iterator(); iterator.hasNext(); ) { + String message = iterator.next(); TBMCDebugMessageEvent event = new TBMCDebugMessageEvent(message); Bukkit.getPluginManager().callEvent(event); if (event.isSent()) - debugMessagesToSend.remove(message); + iterator.remove(); } } } From cdcf8b9b2e695ef68c4a20b82a6d08f5d7665e89 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 12 Aug 2018 00:27:54 +0200 Subject: [PATCH 2/2] Fixed some channel IDs It breaks Discord custom chat sanitizing --- BuildConfigUpdater/BuildConfigUpdater.iml | 1 + .../main/java/buttondevteam/core/MainPlugin.java | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/BuildConfigUpdater/BuildConfigUpdater.iml b/BuildConfigUpdater/BuildConfigUpdater.iml index 73696cd..4902d56 100644 --- a/BuildConfigUpdater/BuildConfigUpdater.iml +++ b/BuildConfigUpdater/BuildConfigUpdater.iml @@ -12,6 +12,7 @@ + diff --git a/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java b/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java index 5e0f094..beb7651 100755 --- a/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java +++ b/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java @@ -51,13 +51,13 @@ public class MainPlugin extends JavaPlugin { Channel.AdminChat = new Channel("§cADMIN§f", Color.Red, "a", Channel.inGroupFilter(null))); TBMCChatAPI.RegisterChatChannel( Channel.ModChat = new Channel("§9MOD§f", Color.Blue, "mod", Channel.inGroupFilter("mod"))); - TBMCChatAPI.RegisterChatChannel(new Channel("§6DEV§", Color.Gold, "dev", Channel.inGroupFilter("developer"))); - TBMCChatAPI.RegisterChatChannel(new ChatRoom("§cRED", Color.DarkRed, "red")); - TBMCChatAPI.RegisterChatChannel(new ChatRoom("§6ORANGE", Color.Gold, "orange")); - TBMCChatAPI.RegisterChatChannel(new ChatRoom("§eYELLOW", Color.Yellow, "yellow")); - TBMCChatAPI.RegisterChatChannel(new ChatRoom("§aGREEN", Color.Green, "green")); - TBMCChatAPI.RegisterChatChannel(new ChatRoom("§bBLUE", Color.Blue, "blue")); - TBMCChatAPI.RegisterChatChannel(new ChatRoom("§5PURPLE", Color.DarkPurple, "purple")); + TBMCChatAPI.RegisterChatChannel(new Channel("§6DEV§f", Color.Gold, "dev", Channel.inGroupFilter("developer"))); + TBMCChatAPI.RegisterChatChannel(new ChatRoom("§cRED§f", Color.DarkRed, "red")); + TBMCChatAPI.RegisterChatChannel(new ChatRoom("§6ORANGE§f", Color.Gold, "orange")); + TBMCChatAPI.RegisterChatChannel(new ChatRoom("§eYELLOW§f", Color.Yellow, "yellow")); + TBMCChatAPI.RegisterChatChannel(new ChatRoom("§aGREEN§f", Color.Green, "green")); + TBMCChatAPI.RegisterChatChannel(new ChatRoom("§bBLUE§f", Color.Blue, "blue")); + TBMCChatAPI.RegisterChatChannel(new ChatRoom("§5PURPLE§f", Color.DarkPurple, "purple")); try { Files.write(new File("plugins", "plugins.txt").toPath(), Arrays.stream(Bukkit.getPluginManager().getPlugins()).map(p -> (CharSequence) p.getDataFolder().getName())::iterator); } catch (IOException e) {