diff --git a/Plugins/Mineplex.Core/src/mineplex/core/slack/SlackAPI.java b/Plugins/Mineplex.Core/src/mineplex/core/slack/SlackAPI.java index 570319d79..a06027325 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/slack/SlackAPI.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/slack/SlackAPI.java @@ -23,13 +23,14 @@ public class SlackAPI public static final String DEFAULT_ICON = ":mineplex:"; // Singular instance. - private static SlackAPI _instance; + private static final SlackAPI _instance = new SlackAPI(); // Don't allow instantiation elsewhere. private SlackAPI() {} /** - * Sends a message asynchronously to a Slack channel. + *
Sends a message to a Slack channel
+ *Will be run asynchronously if called from the main thread, else it will execute immediately on the current thread
* * @param team The team which contains the target channel. * @param channel The target channel for the message. @@ -59,7 +60,8 @@ public class SlackAPI if (Bukkit.isPrimaryThread()) { ThreadPool.ASYNC.execute(send); - } else + } + else { send.run(); } @@ -132,11 +134,6 @@ public class SlackAPI */ public static SlackAPI getInstance() { - if (_instance == null) - { - _instance = new SlackAPI(); - } - return _instance; } -} \ No newline at end of file +}