mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
idk why that wasn't working
This commit is contained in:
parent
538e2a6002
commit
17154ef1d5
@ -28,7 +28,7 @@ public abstract class UUIDHandlerImplementation {
|
||||
public UUIDWrapper uuidWrapper;
|
||||
private boolean cached = false;
|
||||
private BiMap<StringWrapper, UUID> uuidMap = HashBiMap.create(new HashMap<StringWrapper, UUID>());
|
||||
private BiMap<UUID, StringWrapper> nameMap = uuidMap.inverse();
|
||||
// private BiMap<UUID, StringWrapper> 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<UUID, StringWrapper> inverse = this.nameMap;
|
||||
if (inverse.containsKey(uuid)) {
|
||||
if (this.uuidMap.inverse().containsKey(uuid)) {
|
||||
if (this.uuidMap.containsKey(name)) {
|
||||
continue;
|
||||
}
|
||||
@ -166,8 +165,9 @@ public abstract class UUIDHandlerImplementation {
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
StringWrapper oName = this.nameMap.get(offline);
|
||||
StringWrapper oName = this.uuidMap.inverse().get(offline);
|
||||
if (!oName.equals(name)) {
|
||||
System.out.println("Remove " + name);
|
||||
this.uuidMap.remove (name);
|
||||
this.uuidMap.put(name, uuid);
|
||||
}
|
||||
@ -175,7 +175,7 @@ public abstract class UUIDHandlerImplementation {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
BiMap<UUID, StringWrapper> inverse = this.nameMap;
|
||||
BiMap<UUID, StringWrapper> 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user