From 17154ef1d53bff6ad0bf742901ddf9248eb65df9 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 18 Aug 2017 23:34:27 +1000 Subject: [PATCH] idk why that wasn't working --- .../plot/util/UUIDHandlerImplementation.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; }