From e36fdb987082c3a8ee8589b924a6f23e255102dd Mon Sep 17 00:00:00 2001 From: LlmDl Date: Mon, 5 Jun 2023 15:26:01 -0500 Subject: [PATCH] - Handle knock-off Essentials plugins fooling TownyChat into hooking the real EssentialsX. --- resources/changelog.txt | 3 ++- src/com/palmergames/bukkit/TownyChat/Chat.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/changelog.txt b/resources/changelog.txt index ea1d94b..c84dd0e 100644 --- a/resources/changelog.txt +++ b/resources/changelog.txt @@ -463,4 +463,5 @@ v0.106: - Fix version check, courtesy of Warrior with PR #48. - Update min. Towny version to 0.99.1.0. v0.107: - - Remove usage of Version, using new Towny version checker instead. \ No newline at end of file + - Remove usage of Version, using new Towny version checker instead. + - Handle knock-off Essentials plugins fooling TownyChat into hooking the real EssentialsX. \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/Chat.java b/src/com/palmergames/bukkit/TownyChat/Chat.java index a4bda4a..aa871f3 100644 --- a/src/com/palmergames/bukkit/TownyChat/Chat.java +++ b/src/com/palmergames/bukkit/TownyChat/Chat.java @@ -17,6 +17,7 @@ import com.palmergames.bukkit.towny.scheduling.TaskScheduler; import com.palmergames.bukkit.towny.scheduling.impl.BukkitTaskScheduler; import com.palmergames.bukkit.towny.scheduling.impl.FoliaTaskScheduler; import com.palmergames.util.FileMgmt; +import com.palmergames.util.JavaUtil; import org.bukkit.Bukkit; import org.bukkit.command.Command; @@ -174,7 +175,7 @@ public class Chat extends JavaPlugin { } test = pm.getPlugin("Essentials"); - if (test != null) { + if (test != null && JavaUtil.classExists("com.earth2me.essentials.Essentials")) { this.essentials = (Essentials) test; }