Fix bugs in purge classes, cleanup

- OfflinePlayer objects were never mapped to names
- Essentials purge was run even if setting was disabled
- Console user saw messages twice
- Misc: trivial field reorderings, change DefaultPermission to be null safe
- Permissions: do not expose PermissionHandler just to get its type
This commit is contained in:
ljacqu
2016-06-19 17:56:50 +02:00
parent a0abe3d19d
commit ff2f8a63bb
6 changed files with 18 additions and 25 deletions
@@ -1,6 +1,5 @@
package fr.xephi.authme.permission;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
/**
@@ -30,8 +29,8 @@ public enum DefaultPermission {
@Override
public boolean evaluateOffline(String name) {
// TODO Gnat008 20160617: Is this safe?
return Bukkit.getOfflinePlayer(name).isOp();
// TODO #784: Check if there is an elegant way to evaluate OP status
return false;
}
},
@@ -217,12 +217,12 @@ public class PermissionsManager {
}
/**
* Get the current permissions system handler.
* Return the permissions system that is hooked into.
*
* @return The permissions system handler.
* @return The permissions system, or null.
*/
public PermissionHandler getHandler() {
return handler;
public PermissionsSystemType getPermissionSystem() {
return isEnabled() ? handler.getPermissionSystem() : null;
}
/**