From ce5ffb9bd715ab187e3b9b0e653021f9911f13bc Mon Sep 17 00:00:00 2001 From: vemacs Date: Tue, 2 Jun 2015 17:09:03 -0600 Subject: [PATCH] Call superclass constructor for GroupManager, fixes #48 --- .../earth2me/essentials/perm/GroupManagerHandler.java | 1 + .../earth2me/essentials/perm/PermissionsExHandler.java | 9 +-------- .../com/earth2me/essentials/perm/PermissionsHandler.java | 3 +-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java index 472eef037..03e765739 100644 --- a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java @@ -11,6 +11,7 @@ public class GroupManagerHandler extends AbstractVaultHandler { private final transient GroupManager groupManager; public GroupManagerHandler(final Plugin permissionsPlugin) { + super(); groupManager = ((GroupManager) permissionsPlugin); } diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java index 78c5fd3d2..9dd3c9194 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java @@ -1,20 +1,13 @@ package com.earth2me.essentials.perm; import org.bukkit.entity.Player; -import ru.tehkode.permissions.PermissionManager; import ru.tehkode.permissions.PermissionUser; import ru.tehkode.permissions.bukkit.PermissionsEx; public class PermissionsExHandler extends AbstractVaultHandler { - private final transient PermissionManager manager; - - public PermissionsExHandler() { - manager = PermissionsEx.getPermissionManager(); - } - @Override public boolean canBuild(final Player base, final String group) { - final PermissionUser user = manager.getUser(base.getUniqueId()); + final PermissionUser user = PermissionsEx.getPermissionManager().getUser(base.getUniqueId()); return user != null && user.getOptionBoolean("build", base.getWorld().getName(), false); } } diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java index cad220806..2e9704a08 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java @@ -8,7 +8,6 @@ import org.bukkit.plugin.PluginManager; import java.util.Collections; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; public class PermissionsHandler implements IPermissionsHandler { @@ -147,9 +146,9 @@ public class PermissionsHandler implements IPermissionsHandler { if (vault.setupProviders()) { ess.getLogger().info("Using generic Vault based permissions."); handler = vault; + return; } } - return; } if (useSuperperms) {