From fffa3881dd7f20c6e0cde480d0a027ff9dbfc878 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Sat, 15 Sep 2012 02:39:38 +0200 Subject: [PATCH] We won't try to fix TagAPI. Instead, we'll warn the users. --- .../comphenix/protocol/ProtocolLibrary.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ProtocolLib/src/com/comphenix/protocol/ProtocolLibrary.java b/ProtocolLib/src/com/comphenix/protocol/ProtocolLibrary.java index b2af48cc..3a4b7ae3 100644 --- a/ProtocolLib/src/com/comphenix/protocol/ProtocolLibrary.java +++ b/ProtocolLib/src/com/comphenix/protocol/ProtocolLibrary.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; +import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -52,8 +53,13 @@ public class ProtocolLibrary extends JavaPlugin { // Player login and logout events protocolManager.registerEvents(manager, this); + + // Inject our hook into already existing players protocolManager.initializePlayers(server.getOnlinePlayers()); + // Notify server managers of incompatible plugins + checkForIncompatibility(manager); + // Try to enable statistics try { statistisc = new Statistics(this); @@ -63,7 +69,19 @@ public class ProtocolLibrary extends JavaPlugin { logger.log(Level.SEVERE, "Metrics cannot be enabled. Incompatible Bukkit version.", e); } } + + private void checkForIncompatibility(PluginManager manager) { + // Plugin authors: Notify me to remove these + String[] incompatiblePlugins = { "TagAPI" }; + for (String plugin : incompatiblePlugins) { + if (manager.getPlugin(plugin) != null) { + // Check for versions, ect. + logger.severe(ChatColor.RED + "Detected incompatible plugin: " + plugin); + } + } + } + @Override public void onDisable() { protocolManager.close();