From a6232b6bb6f6a0a11282a7091fb4ae6fa6f4197c Mon Sep 17 00:00:00 2001 From: vemacs Date: Fri, 19 Jun 2015 15:47:58 -0400 Subject: [PATCH] [Untested] [Experimental] PermissionsHandler cleanup, add specific logging to detect Vault with no perms plugin --- .../com/earth2me/essentials/perm/PermissionsHandler.java | 6 +++++- .../earth2me/essentials/perm/impl/AbstractVaultHandler.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java index 61f909b6e..fd6ad87ab 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.perm; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.perm.impl.*; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import java.util.Arrays; @@ -125,7 +126,10 @@ public class PermissionsHandler implements IPermissionsHandler { ((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 { + } else if (Bukkit.getPluginManager().getPlugin("Vault") != null) { + ess.getLogger().info("Detected Vault but no supported permissions plugin. Using superperms based permissions."); + } + { ess.getLogger().info("Using superperms-based permissions."); } } else if (handler instanceof ConfigPermissionsHandler) { diff --git a/Essentials/src/com/earth2me/essentials/perm/impl/AbstractVaultHandler.java b/Essentials/src/com/earth2me/essentials/perm/impl/AbstractVaultHandler.java index 222a0d17e..8210a2004 100644 --- a/Essentials/src/com/earth2me/essentials/perm/impl/AbstractVaultHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/impl/AbstractVaultHandler.java @@ -66,6 +66,7 @@ public abstract class AbstractVaultHandler extends SuperpermsHandler { } public boolean canLoad() { + if (Bukkit.getPluginManager().getPlugin("Vault") == null) return false; try { return setupProviders(); } catch (Throwable t) {