From 97e34844b441926da91e2551e7c0865e1ad38345 Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Wed, 2 Sep 2020 12:13:23 +0200 Subject: [PATCH] Add option to opt-out MvDW Placeholder API --- Bukkit/pom.xml | 2 +- .../plotsquared/bukkit/listener/ServerListener.java | 3 ++- Core/pom.xml | 12 ++++++------ .../com/plotsquared/core/configuration/Settings.java | 4 +++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Bukkit/pom.xml b/Bukkit/pom.xml index 4119b792b..ef3ad830a 100644 --- a/Bukkit/pom.xml +++ b/Bukkit/pom.xml @@ -21,7 +21,7 @@ com.plotsquared PlotSquared-Core - 5.13.2 + 5.13.3 compile diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ServerListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ServerListener.java index c74db87d4..60842c2d9 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ServerListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ServerListener.java @@ -29,6 +29,7 @@ import com.plotsquared.bukkit.BukkitMain; import com.plotsquared.bukkit.placeholder.MVdWPlaceholders; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Captions; +import com.plotsquared.core.configuration.Settings; import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -43,7 +44,7 @@ public class ServerListener implements Listener { } @EventHandler public void onServerLoad(ServerLoadEvent event) { - if (Bukkit.getPluginManager().getPlugin("MVdWPlaceholderAPI") != null) { + if (Bukkit.getPluginManager().getPlugin("MVdWPlaceholderAPI") != null && Settings.Enabled_Components.USE_MVDWAPI) { new MVdWPlaceholders(this.plugin, PlotSquared.get().getPlaceholderRegistry()); PlotSquared.log(Captions.PREFIX + "&6PlotSquared hooked into MVdWPlaceholderAPI"); } diff --git a/Core/pom.xml b/Core/pom.xml index d69f10a99..ad175038f 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -18,12 +18,6 @@ 1.18.12 runtime - - org.jetbrains - annotations - 19.0.0 - runtime - com.sk89q.worldedit worldedit-core @@ -92,6 +86,12 @@ 1.3.72 runtime + + org.jetbrains + annotations + 20.0.0 + runtime + org.khelekore prtree diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index e2fdfde60..81ac560bf 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -582,7 +582,7 @@ public class Settings extends Config { @Comment("Actively purge invalid database entries") public static boolean DATABASE_PURGER = false; @Comment({"Delete plots when a player is banned.", - "Note: This only works with the /minecraft:ban command. Any punishment plugin like LiteBans is not supported."}) public static boolean BAN_DELETER = false; + "Note: This only works with the /minecraft:ban command. Any punishment plugin is not supported."}) public static boolean BAN_DELETER = false; @Comment("Allows PlaceholderAPI placeholders to be used in captions, flags, etc.") public static boolean EXTERNAL_PLACEHOLDERS = true; @Comment("Make road regeneration persistent across restarts") public static boolean @@ -593,6 +593,8 @@ public class Settings extends Config { public static boolean EXTENDED_USERNAME_COMPLETION = true; @Comment("Command aliases that will be tab completed") public static List TAB_COMPLETED_ALIASES = Arrays.asList("plot", "plots", "p", "plotsquared", "plot2", "p2", "ps", "2", "plotme", "plotz", "ap"); + @Comment("Whether PlotSquared should hook into MvDWPlaceholderAPI or not") + public static boolean USE_MVDWAPI = true; } }