diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-10-03 10:19:31 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-10-03 10:19:31 +0100 |
commit | aa0935c64bf46fafe350e51e6b2a128c448126c9 (patch) | |
tree | cc839357c08f18236617c58abb79a66b51beafc0 /EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java | |
parent | 16111b56adeee3b18329a6d198c4a58ac5b84083 (diff) | |
parent | 49e2c38289f4ca2eaa09f4f469376b45772ca8c0 (diff) | |
download | Essentials-aa0935c64bf46fafe350e51e6b2a128c448126c9.tar Essentials-aa0935c64bf46fafe350e51e6b2a128c448126c9.tar.gz Essentials-aa0935c64bf46fafe350e51e6b2a128c448126c9.tar.lz Essentials-aa0935c64bf46fafe350e51e6b2a128c448126c9.tar.xz Essentials-aa0935c64bf46fafe350e51e6b2a128c448126c9.zip |
Merge remote branch 'remotes/ess/groupmanager' into essmaster
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 20f6331bc..19d90854b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -43,7 +43,6 @@ import org.bukkit.event.server.ServerListener; import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
-//import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
@@ -93,7 +92,7 @@ public class BukkitPermissions { manager.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, plugin);
}
- private void collectPermissions() {
+ public void collectPermissions() {
registeredPermissions.clear();
for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) {
for(Permission permission : bukkitPlugin.getDescription().getPermissions())
@@ -134,8 +133,8 @@ public class BukkitPermissions { Boolean value;
for (Permission permission : registeredPermissions) {
value = worldData.getPermissionsHandler().checkUserPermission(user, permission.getName());
-
- attachment.setPermission(permission, value);
+ if (value == true)
+ attachment.setPermission(permission, value);
}
// Add any missing permissions for this player (non bukkit plugins)
@@ -199,7 +198,7 @@ public class BukkitPermissions { @Override
public void onPlayerPortal(PlayerPortalEvent event) { // will portal into another world
- if(!event.getFrom().getWorld().equals(event.getTo().getWorld())){ // only if world actually changed
+ if(event.getTo() != null && !event.getFrom().getWorld().equals(event.getTo().getWorld())){ // only if world actually changed
updatePermissions(event.getPlayer(), event.getTo().getWorld().getName());
}
}
@@ -211,7 +210,7 @@ public class BukkitPermissions { @Override
public void onPlayerTeleport(PlayerTeleportEvent event) { // can be teleported into another world
- if (!event.getFrom().getWorld().equals(event.getTo().getWorld())) { // only if world actually changed
+ if (event.getTo() != null && !event.getFrom().getWorld().equals(event.getTo().getWorld())) { // only if world actually changed
updatePermissions(event.getPlayer(), event.getTo().getWorld().getName());
}
}
|