summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java9
2 files changed, 13 insertions, 0 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index c10658fb0..77cca7b1e 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -256,6 +256,10 @@ public class User extends DataUnit implements Cloneable {
}
}
+ public void clearPlayer() {
+ bukkitPlayer = null;
+ }
+
public User updatePlayer(Player player) {
if (player != null) {
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index e8322c391..bd48d5079 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -31,6 +31,7 @@ import java.util.Set;
import java.util.WeakHashMap;
import org.anjocaido.groupmanager.GroupManager;
+import org.anjocaido.groupmanager.data.User;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -441,6 +442,10 @@ public class BukkitPermissions {
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
*/
@@ -454,6 +459,10 @@ 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