summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-06-16 19:04:40 +0100
committerElgarL <ElgarL@palmergames.com>2012-06-16 19:04:40 +0100
commit78d4987d5d86e13b5fa36f20adb658e8459b043b (patch)
tree7c58155d4dcb8c70755725d9c96fb914786dbf2a /EssentialsGroupManager
parent06247732da564876d97de99aa706fd7e823c0df9 (diff)
downloadEssentials-78d4987d5d86e13b5fa36f20adb658e8459b043b.tar
Essentials-78d4987d5d86e13b5fa36f20adb658e8459b043b.tar.gz
Essentials-78d4987d5d86e13b5fa36f20adb658e8459b043b.tar.lz
Essentials-78d4987d5d86e13b5fa36f20adb658e8459b043b.tar.xz
Essentials-78d4987d5d86e13b5fa36f20adb658e8459b043b.zip
Clear the player reference on logout so it's refreshed upon a reconnect.
Diffstat (limited to 'EssentialsGroupManager')
-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