Fix UtilsTest and replace the last test setups not to use reflections
This commit is contained in:
@@ -3,6 +3,7 @@ package fr.xephi.authme.command.executable.logout;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.command.CommandParts;
|
||||
import fr.xephi.authme.command.ExecutableCommand;
|
||||
import fr.xephi.authme.util.Wrapper;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class LogoutCommand extends ExecutableCommand {
|
||||
}
|
||||
|
||||
// Get the player instance
|
||||
final AuthMe plugin = AuthMe.getInstance();
|
||||
final AuthMe plugin = Wrapper.getInstance().getAuthMe();
|
||||
final Player player = (Player) sender;
|
||||
|
||||
// Logout the player
|
||||
|
||||
@@ -53,18 +53,22 @@ public final class Utils {
|
||||
*/
|
||||
public static boolean setGroup(Player player, GroupType group) {
|
||||
// Check whether the permissions check is enabled
|
||||
if (!Settings.isPermissionCheckEnabled)
|
||||
if (!Settings.isPermissionCheckEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the permissions manager, and make sure it's valid
|
||||
PermissionsManager permsMan = plugin.getPermissionsManager();
|
||||
if (permsMan == null)
|
||||
if (permsMan == null) {
|
||||
ConsoleLogger.showError("Failed to access permissions manager instance, shutting down.");
|
||||
assert permsMan != null;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure group support is available
|
||||
if (!permsMan.hasGroupSupport())
|
||||
if (!permsMan.hasGroupSupport()) {
|
||||
ConsoleLogger.showError("The current permissions system doesn't have group support, unable to set group!");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (group) {
|
||||
case UNREGISTERED:
|
||||
|
||||
Reference in New Issue
Block a user