diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 4fe65709c..d9d176946 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1310,4 +1310,9 @@ public class OfflinePlayer implements Player { public Map serialize() { return base.serialize(); } + + @Override + public Entity getSpectatorTarget() { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java index 9b95f4ec5..33f2b335c 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java @@ -102,8 +102,8 @@ public class PermissionsHandler implements IPermissionsHandler { for (Class providerClass : providerClazz) { try { IPermissionsHandler provider = providerClass.newInstance(); - this.handler = provider; if (provider.tryProvider()) { + this.handler = provider; break; } } catch (Throwable ignored) { @@ -120,17 +120,15 @@ public class PermissionsHandler implements IPermissionsHandler { String enabledPermsPlugin = ((GenericVaultHandler) handler).getEnabledPermsPlugin(); if (enabledPermsPlugin == null) enabledPermsPlugin = "generic"; ess.getLogger().info("Using Vault based permissions (" + enabledPermsPlugin + ")"); - } else if (handler instanceof SuperpermsHandler) { + } else if (handler.getClass() == SuperpermsHandler.class) { if (handler.tryProvider()) { ess.getLogger().warning("Detected supported permissions plugin " + ((SuperpermsHandler) handler).getEnabledPermsPlugin() + " without Vault installed."); ess.getLogger().warning("Features such as chat prefixes/suffixes and group-related functionality will not " + "work until you install Vault."); - } else if (Bukkit.getPluginManager().getPlugin("Vault") != null) { - ess.getLogger().info("Detected Vault but no supported permissions plugin."); } ess.getLogger().info("Using superperms-based permissions."); - } else if (handler instanceof ConfigPermissionsHandler) { + } else if (handler.getClass() == ConfigPermissionsHandler.class) { ess.getLogger().info("Using config file enhanced permissions."); ess.getLogger().info("Permissions listed in as player-commands will be given to all users."); }