mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 11:55:38 +01:00
parent
765a021ecd
commit
c23086259d
@ -161,19 +161,19 @@ public abstract class UUIDHandlerImplementation {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
UUID offline = this.uuidMap.put(name, uuid);
|
UUID existing = this.uuidMap.put(name, uuid);
|
||||||
if (offline != null) {
|
if (existing != null) {
|
||||||
if (!offline.equals(uuid)) {
|
if (!existing.equals(uuid)) {
|
||||||
Set<Plot> plots = PlotSquared.get().getPlots(offline);
|
Set<Plot> plots = PlotSquared.get().getPlots(existing);
|
||||||
if (!plots.isEmpty()) {
|
if (!plots.isEmpty()) {
|
||||||
for (Plot plot : plots) {
|
for (Plot plot : plots) {
|
||||||
plot.owner = uuid;
|
plot.owner = uuid;
|
||||||
}
|
}
|
||||||
replace(offline, uuid, name.value);
|
replace(existing, uuid, name.value);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
StringWrapper oName = this.uuidMap.inverse().get(offline);
|
StringWrapper oName = this.uuidMap.inverse().get(existing);
|
||||||
if (!oName.equals(name)) {
|
if (!oName.equals(name)) {
|
||||||
this.uuidMap.remove(name);
|
this.uuidMap.remove(name);
|
||||||
this.uuidMap.put(name, uuid);
|
this.uuidMap.put(name, uuid);
|
||||||
@ -191,6 +191,13 @@ public abstract class UUIDHandlerImplementation {
|
|||||||
PlotPlayer player = getPlayer(uuid);
|
PlotPlayer player = getPlayer(uuid);
|
||||||
if (player == null || player.getName().equalsIgnoreCase(name.value)) {
|
if (player == null || player.getName().equalsIgnoreCase(name.value)) {
|
||||||
rename(uuid, name);
|
rename(uuid, name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
StringWrapper newName = new StringWrapper(player.getName());
|
||||||
|
UUID newUUID = player.getUUID();
|
||||||
|
if (newUUID.equals(uuid) && !newName.equals(oldName)) {
|
||||||
|
inverse.remove(uuid);
|
||||||
|
this.uuidMap.put(newName, newUUID);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user