Change how we detect spigot #1531

This commit is contained in:
Gabriele C 2018-03-19 17:23:51 +01:00
parent aab5d71efd
commit 3a690fd79a

View File

@ -1,6 +1,7 @@
package fr.xephi.authme.util; package fr.xephi.authme.util;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.ConsoleCommandSender;
@ -28,7 +29,12 @@ public final class Utils {
* @return true if the running server instance is spigot-based. * @return true if the running server instance is spigot-based.
*/ */
public static boolean isSpigot() { public static boolean isSpigot() {
return isClassLoaded("org.spigotmc.SpigotConfig"); try {
Bukkit.spigot();
return true;
} catch (NoSuchMethodError e) {
return false;
}
} }
/** /**