diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java b/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java index c1005159c..05d32b4f4 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java @@ -28,7 +28,7 @@ public abstract class UUIDHandlerImplementation { public UUIDWrapper uuidWrapper; private boolean cached = false; private BiMap uuidMap = HashBiMap.create(new HashMap()); - private BiMap nameMap = uuidMap.inverse(); +// private BiMap nameMap = uuidMap.inverse(); public UUIDHandlerImplementation(UUIDWrapper wrapper) { this.uuidWrapper = wrapper; @@ -62,7 +62,7 @@ public abstract class UUIDHandlerImplementation { } public void rename(UUID uuid, StringWrapper name) { - this.nameMap.remove(uuid); + this.uuidMap.inverse().remove(uuid); this.uuidMap.put(name, uuid); } @@ -76,8 +76,7 @@ public abstract class UUIDHandlerImplementation { if (uuid == null || name == null) { continue; } - BiMap inverse = this.nameMap; - if (inverse.containsKey(uuid)) { + if (this.uuidMap.inverse().containsKey(uuid)) { if (this.uuidMap.containsKey(name)) { continue; } @@ -166,16 +165,17 @@ public abstract class UUIDHandlerImplementation { } return true; } else { - StringWrapper oName = this.nameMap.get(offline); + StringWrapper oName = this.uuidMap.inverse().get(offline); if (!oName.equals(name)) { - this.uuidMap.remove(name); + System.out.println("Remove " + name); + this.uuidMap.remove (name); this.uuidMap.put(name, uuid); } } return false; } } catch (Exception ignored) { - BiMap inverse = this.nameMap; + BiMap inverse = this.uuidMap.inverse(); if (inverse.containsKey(uuid)) { if (this.uuidMap.containsKey(name)) { return false; @@ -216,7 +216,7 @@ public abstract class UUIDHandlerImplementation { if (uuid == null) { return null; } - StringWrapper name = this.nameMap.get(uuid); + StringWrapper name = this.uuidMap.inverse().get(uuid); if (name != null) { return name.value; }