From 06c25e2c88da6f185efd8dbbea4dee6d5325fc9d Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 27 Jan 2011 09:51:23 -0800 Subject: [PATCH] Changed the sessions map to index by player name as a string. --- src/com/sk89q/worldedit/WorldEdit.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/sk89q/worldedit/WorldEdit.java b/src/com/sk89q/worldedit/WorldEdit.java index d0898c4af..dc486381d 100644 --- a/src/com/sk89q/worldedit/WorldEdit.java +++ b/src/com/sk89q/worldedit/WorldEdit.java @@ -62,8 +62,8 @@ public class WorldEdit { * without any WorldEdit abilities or never use WorldEdit in a session will * not have a session object generated for them. */ - private HashMap sessions = - new HashMap(); + private HashMap sessions = + new HashMap(); /** * List of commands. These are checked when the command event is called, so @@ -189,8 +189,8 @@ public class WorldEdit { * @return */ public LocalSession getSession(LocalPlayer player) { - if (sessions.containsKey(player)) { - return sessions.get(player); + if (sessions.containsKey(player.getName())) { + return sessions.get(player.getName()); } LocalSession session = new LocalSession(); @@ -223,7 +223,7 @@ public class WorldEdit { || !player.hasPermission("worldeditunlimited"))); // Remember the session - sessions.put(player, session); + sessions.put(player.getName(), session); return session; } @@ -235,7 +235,7 @@ public class WorldEdit { * @return */ public boolean hasSession(LocalPlayer player) { - return sessions.containsKey(player); + return sessions.containsKey(player.getName()); } /** @@ -1866,7 +1866,7 @@ public class WorldEdit { * @param player */ public void removeSession(LocalPlayer player) { - sessions.remove(player); + sessions.remove(player.getName()); } /**