mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
@ -249,8 +249,8 @@ public abstract class HybridUtils {
|
||||
@Override
|
||||
public void run(Object value) {
|
||||
long start = System.currentTimeMillis();
|
||||
Iterator<ChunkLoc> iterator = chunks.iterator();
|
||||
while (System.currentTimeMillis() - start < 20 && !chunks.isEmpty()) {
|
||||
Iterator<ChunkLoc> iterator = chunks.iterator();
|
||||
final ChunkLoc chunk = iterator.next();
|
||||
iterator.remove();
|
||||
regenerateRoad(area, chunk, extend);
|
||||
|
@ -33,6 +33,9 @@ public class StringWrapper {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (obj.getClass() == String.class) {
|
||||
return obj.toString().equalsIgnoreCase(this.value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (obj.hashCode() != hashCode()) {
|
||||
@ -42,7 +45,7 @@ public class StringWrapper {
|
||||
if ((other.value == null) || (this.value == null)) {
|
||||
return false;
|
||||
}
|
||||
return other.value.equalsIgnoreCase(this.value.toLowerCase());
|
||||
return other.value.equalsIgnoreCase(this.value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +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();
|
||||
|
||||
public UUIDHandlerImplementation(UUIDWrapper wrapper) {
|
||||
this.uuidWrapper = wrapper;
|
||||
@ -61,7 +62,7 @@ public abstract class UUIDHandlerImplementation {
|
||||
}
|
||||
|
||||
public void rename(UUID uuid, StringWrapper name) {
|
||||
this.uuidMap.inverse().remove(uuid);
|
||||
this.nameMap.remove(uuid);
|
||||
this.uuidMap.put(name, uuid);
|
||||
}
|
||||
|
||||
@ -75,7 +76,7 @@ public abstract class UUIDHandlerImplementation {
|
||||
if (uuid == null || name == null) {
|
||||
continue;
|
||||
}
|
||||
BiMap<UUID, StringWrapper> inverse = this.uuidMap.inverse();
|
||||
BiMap<UUID, StringWrapper> inverse = this.nameMap;
|
||||
if (inverse.containsKey(uuid)) {
|
||||
if (this.uuidMap.containsKey(name)) {
|
||||
continue;
|
||||
@ -164,11 +165,17 @@ public abstract class UUIDHandlerImplementation {
|
||||
replace(offline, uuid, name.value);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
StringWrapper oName = this.nameMap.get(offline);
|
||||
if (!oName.equals(name)) {
|
||||
this.uuidMap.remove(name);
|
||||
this.uuidMap.put(name, uuid);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
BiMap<UUID, StringWrapper> inverse = this.uuidMap.inverse();
|
||||
BiMap<UUID, StringWrapper> inverse = this.nameMap;
|
||||
if (inverse.containsKey(uuid)) {
|
||||
if (this.uuidMap.containsKey(name)) {
|
||||
return false;
|
||||
@ -209,7 +216,7 @@ public abstract class UUIDHandlerImplementation {
|
||||
if (uuid == null) {
|
||||
return null;
|
||||
}
|
||||
StringWrapper name = this.uuidMap.inverse().get(uuid);
|
||||
StringWrapper name = this.nameMap.get(uuid);
|
||||
if (name != null) {
|
||||
return name.value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user