Add support for EssentialsDiscord (#33)

* Add initial support for EssentialsDiscord

* Fixup some stuff

* Exclude JDA

* Restore ChannelsHolder.java

* Fix canceled logic

* Fix bool logic

* Make sure direct channel always gets handled

* Remove isHooked check

* Add javadoc to EssentialsDiscordHookListener, remove unneeded diff.

Co-authored-by: Llm Dl <[email protected]>
This commit is contained in:
Josh RoyandLlm Dl authored and GitHub committed 2021-06-27 09:48:34 -05:00
1 parent ce03d1dd5c
commit 5bee9611aa
5 files changed
+81 -3

No files matched your search

+11 -1
View File
@@ -7,6 +7,7 @@ import com.palmergames.bukkit.TownyChat.channels.Channel;
import com.palmergames.bukkit.TownyChat.channels.ChannelsHolder;
import com.palmergames.bukkit.TownyChat.config.ChatSettings;
import com.palmergames.bukkit.TownyChat.config.ConfigurationHandler;
import com.palmergames.bukkit.TownyChat.listener.EssentialsDiscordHookListener;
import com.palmergames.bukkit.TownyChat.listener.TownyChatPlayerListener;
import com.palmergames.bukkit.TownyChat.tasks.onLoadedTask;
import com.palmergames.bukkit.TownyChat.util.FileMgmt;
@@ -47,6 +48,7 @@ public class Chat extends JavaPlugin {
private static Version requiredTownyVersion = Version.fromString("0.97.0.0");
public static boolean usingPlaceholderAPI = false;
public static boolean usingEssentialsDiscord = false;
boolean chatConfigError = false;
boolean channelsConfigError = false;
@@ -144,6 +146,11 @@ public class Chat extends JavaPlugin {
usingPlaceholderAPI = true;
}
test = pm.getPlugin("EssentialsDiscord");
if (test != null) {
usingEssentialsDiscord = true;
}
}
public void registerEvents() {
@@ -154,7 +161,10 @@ public class Chat extends JavaPlugin {
if (TownyPlayerListener != null)
pm.registerEvents(TownyPlayerListener, this);
}
if (usingEssentialsDiscord) {
pm.registerEvents(new EssentialsDiscordHookListener(this), this);
}
}
public void registerPermissions() {