mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix potential race condition.
I guess.
This commit is contained in:
parent
a9b3fb1429
commit
e504c29df6
@ -316,15 +316,16 @@ public class BukkitWorld extends AbstractWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
if (worldRef.get() == null) {
|
final World ref = worldRef.get();
|
||||||
|
if (ref == null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (other == null) {
|
} else if (other == null) {
|
||||||
return false;
|
return false;
|
||||||
} else if ((other instanceof BukkitWorld)) {
|
} else if ((other instanceof BukkitWorld)) {
|
||||||
World otherWorld = ((BukkitWorld) other).worldRef.get();
|
World otherWorld = ((BukkitWorld) other).worldRef.get();
|
||||||
return otherWorld != null && otherWorld.equals(getWorld());
|
return ref.equals(otherWorld);
|
||||||
} else if (other instanceof com.sk89q.worldedit.world.World) {
|
} else if (other instanceof com.sk89q.worldedit.world.World) {
|
||||||
return ((com.sk89q.worldedit.world.World) other).getName().equals(getName());
|
return ((com.sk89q.worldedit.world.World) other).getName().equals(ref.getName());
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user