From 6a6c590a07f42d637bef6e44c710d2129785fc68 Mon Sep 17 00:00:00 2001 From: zml Date: Sat, 10 Jan 2015 16:57:53 -0800 Subject: [PATCH] WEPIF: Use UUIDs wherever possible in PermissionsExResolver --- worldedit-bukkit/build.gradle | 6 +++--- .../main/java/com/sk89q/wepif/PermissionsExResolver.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 440dbd027..ed882a1c0 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -3,9 +3,9 @@ apply plugin: 'idea' dependencies { compile project(':worldedit-core') - compile 'com.sk89q:dummypermscompat:1.7' - compile 'org.sk89q.bukkit:bukkit-classloader-check:1.7.2-R0.3' - compile 'org.bukkit:bukkit:1.7.2-R0.3' + compile 'com.sk89q:dummypermscompat:1.8' + compile 'org.sk89q.bukkit:bukkit-classloader-check:1.7.9-R0.2' + compile 'org.bukkit:bukkit:1.7.9-R0.2' testCompile 'org.mockito:mockito-core:1.9.0-rc1' } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsExResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsExResolver.java index ece76df9d..a50d6b150 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsExResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsExResolver.java @@ -57,7 +57,7 @@ public class PermissionsExResolver extends DinnerPermsResolver { public boolean hasPermission(OfflinePlayer player, String permission) { Permissible permissible = getPermissible(player); if (permissible == null) { - return manager.has(player.getName(), permission, null); + return manager.has(player.getUniqueId(), permission, null); } else { return permissible.hasPermission(permission); } @@ -65,18 +65,18 @@ public class PermissionsExResolver extends DinnerPermsResolver { @Override public boolean hasPermission(String worldName, OfflinePlayer player, String permission) { - return hasPermission(worldName, player.getName(), permission); + return manager.has(player.getUniqueId(), permission, worldName); } @Override public boolean inGroup(OfflinePlayer player, String group) { - return super.inGroup(player, group) || manager.getUser(player.getName()).inGroup(group); + return super.inGroup(player, group) || manager.getUser(player.getUniqueId()).inGroup(group); } @Override public String[] getGroups(OfflinePlayer player) { if (getPermissible(player) == null) { - PermissionUser user = manager.getUser(player.getName()); + PermissionUser user = manager.getUser(player.getUniqueId()); if (user == null) { return new String[0]; }