From 2bdf6ae18a69f27a6f3a5e134c14f15fdc947ec6 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sat, 5 Jun 2021 20:01:06 +0200 Subject: [PATCH] Leave a proper warning if you install WE alongside FAWE --- .../sk89q/worldedit/bukkit/WorldEditPlugin.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index d6f9a549d..bfde6d3ad 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -71,6 +71,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import org.incendo.serverlib.ServerLib; @@ -107,6 +109,19 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter @Override public void onLoad() { + + // FAWE start + // This is already covered by Spigot, however, a more pesky warning with a proper explanation over "Ambiguous plugin name..." can't hurt. + Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins(); + for (Plugin p : plugins) { + if (p.getName().equals("WorldEdit")) { + LOGGER.warn("You installed WorldEdit alongside FastAsyncWorldEdit. That is unneeded and will cause unforeseen issues, " + + "because FastAsyncWorldEdit already provides WorldEdit. " + + "Stop your server and delete the 'worldedit-bukkit' jar from your plugins folder."); + } + } + // FAWE end + INSTANCE = this; //noinspection ResultOfMethodCallIgnored