mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 03:25:29 +01:00
We won't try to fix TagAPI. Instead, we'll warn the users.
This commit is contained in:
parent
85f7360109
commit
fffa3881dd
@ -21,6 +21,7 @@ import java.io.IOException;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@ -52,8 +53,13 @@ public class ProtocolLibrary extends JavaPlugin {
|
|||||||
|
|
||||||
// Player login and logout events
|
// Player login and logout events
|
||||||
protocolManager.registerEvents(manager, this);
|
protocolManager.registerEvents(manager, this);
|
||||||
|
|
||||||
|
// Inject our hook into already existing players
|
||||||
protocolManager.initializePlayers(server.getOnlinePlayers());
|
protocolManager.initializePlayers(server.getOnlinePlayers());
|
||||||
|
|
||||||
|
// Notify server managers of incompatible plugins
|
||||||
|
checkForIncompatibility(manager);
|
||||||
|
|
||||||
// Try to enable statistics
|
// Try to enable statistics
|
||||||
try {
|
try {
|
||||||
statistisc = new Statistics(this);
|
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);
|
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
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
protocolManager.close();
|
protocolManager.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user