summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java7
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java13
2 files changed, 6 insertions, 14 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index 77cca7b1e..6c74c2e50 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -256,15 +256,10 @@ public class User extends DataUnit implements Cloneable {
}
}
- public void clearPlayer() {
- bukkitPlayer = null;
- }
public User updatePlayer(Player player) {
- if (player != null) {
- bukkitPlayer = player;
- }
+ bukkitPlayer = player;
return this;
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index bd48d5079..05e152286 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -145,6 +145,11 @@ public class BukkitPermissions {
if (player == null || !GroupManager.isLoaded()) {
return;
}
+
+ // Reset the User objects player reference.
+ User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName());
+ if (user != null)
+ user.updatePlayer(player);
PermissionAttachment attachment;
@@ -441,10 +446,6 @@ public class BukkitPermissions {
public void onPlayerKick(PlayerKickEvent event) {
Player player = event.getPlayer();
-
- User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName());
- if (user != null)
- user.clearPlayer();
/*
* force remove any attachments as bukkit may not
@@ -459,10 +460,6 @@ public class BukkitPermissions {
return;
Player player = event.getPlayer();
-
- User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName());
- if (user != null)
- user.clearPlayer();
/*
* force remove any attachments as bukkit may not