mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Don't overwrite online player names from uuid cache
This commit is contained in:
parent
24b3b60983
commit
20d7a0eea2
1 changed files with 11 additions and 5 deletions
|
@ -76,11 +76,14 @@ public abstract class UUIDHandlerImplementation {
|
|||
if (uuid == null || name == null) {
|
||||
continue;
|
||||
}
|
||||
if (this.uuidMap.inverse().containsKey(uuid)) {
|
||||
StringWrapper oldName = this.uuidMap.inverse().get(uuid);
|
||||
if (oldName != null) {
|
||||
if (this.uuidMap.containsKey(name)) {
|
||||
continue;
|
||||
}
|
||||
rename(uuid, name);
|
||||
if (getPlayer(uuid) == null) {
|
||||
rename(uuid, name);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
this.uuidMap.put(name, uuid);
|
||||
|
@ -167,7 +170,6 @@ public abstract class UUIDHandlerImplementation {
|
|||
} else {
|
||||
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);
|
||||
}
|
||||
|
@ -176,11 +178,15 @@ public abstract class UUIDHandlerImplementation {
|
|||
}
|
||||
} catch (Exception ignored) {
|
||||
BiMap<UUID, StringWrapper> inverse = this.uuidMap.inverse();
|
||||
if (inverse.containsKey(uuid)) {
|
||||
StringWrapper oldName = inverse.get(uuid);
|
||||
if (oldName != null) {
|
||||
if (this.uuidMap.containsKey(name)) {
|
||||
return false;
|
||||
}
|
||||
rename(uuid, name);
|
||||
PlotPlayer player = getPlayer(uuid);
|
||||
if (player == null || player.getName().equalsIgnoreCase(name.value)) {
|
||||
rename(uuid, name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
this.uuidMap.put(name, uuid);
|
||||
|
|
Loading…
Reference in a new issue