mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 13:05:41 +01:00
Don't overwrite online player names from uuid cache
This commit is contained in:
parent
24b3b60983
commit
20d7a0eea2
@ -76,11 +76,14 @@ public abstract class UUIDHandlerImplementation {
|
|||||||
if (uuid == null || name == null) {
|
if (uuid == null || name == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (this.uuidMap.inverse().containsKey(uuid)) {
|
StringWrapper oldName = this.uuidMap.inverse().get(uuid);
|
||||||
|
if (oldName != null) {
|
||||||
if (this.uuidMap.containsKey(name)) {
|
if (this.uuidMap.containsKey(name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (getPlayer(uuid) == null) {
|
||||||
rename(uuid, name);
|
rename(uuid, name);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
this.uuidMap.put(name, uuid);
|
this.uuidMap.put(name, uuid);
|
||||||
@ -167,7 +170,6 @@ public abstract class UUIDHandlerImplementation {
|
|||||||
} else {
|
} else {
|
||||||
StringWrapper oName = this.uuidMap.inverse().get(offline);
|
StringWrapper oName = this.uuidMap.inverse().get(offline);
|
||||||
if (!oName.equals(name)) {
|
if (!oName.equals(name)) {
|
||||||
System.out.println("Remove " + name);
|
|
||||||
this.uuidMap.remove (name);
|
this.uuidMap.remove (name);
|
||||||
this.uuidMap.put(name, uuid);
|
this.uuidMap.put(name, uuid);
|
||||||
}
|
}
|
||||||
@ -176,11 +178,15 @@ public abstract class UUIDHandlerImplementation {
|
|||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
BiMap<UUID, StringWrapper> inverse = this.uuidMap.inverse();
|
BiMap<UUID, StringWrapper> inverse = this.uuidMap.inverse();
|
||||||
if (inverse.containsKey(uuid)) {
|
StringWrapper oldName = inverse.get(uuid);
|
||||||
|
if (oldName != null) {
|
||||||
if (this.uuidMap.containsKey(name)) {
|
if (this.uuidMap.containsKey(name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
PlotPlayer player = getPlayer(uuid);
|
||||||
|
if (player == null || player.getName().equalsIgnoreCase(name.value)) {
|
||||||
rename(uuid, name);
|
rename(uuid, name);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.uuidMap.put(name, uuid);
|
this.uuidMap.put(name, uuid);
|
||||||
|
Loading…
Reference in New Issue
Block a user