mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-02 06:28:13 +01:00
Fixed bug when creating new islands when there are islands in the world.
If there are unowned and unknown islands in the island spaces then duplicate islands were being made when the search was done for new islands.
This commit is contained in:
parent
c58fc0d07a
commit
52b3f184db
@ -388,22 +388,5 @@ public class IslandCache {
|
||||
public int size() {
|
||||
return islandsByLocation.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get if the cache contains this island
|
||||
* @param island or uuid of owner
|
||||
* @return true if it is in the cache
|
||||
*/
|
||||
public boolean contains(Object o) {
|
||||
if (o instanceof UUID) {
|
||||
return islandsByUUID.containsKey(o);
|
||||
}
|
||||
if (o instanceof Island) {
|
||||
Island is = (Island)o;
|
||||
if (is.getOwner() != null && islandsByUUID.containsKey(is.getOwner())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ public class IslandsManager {
|
||||
return true;
|
||||
}
|
||||
location = getClosestIsland(location);
|
||||
if (islandCache.contains(location)) {
|
||||
if (islandCache.getIslandAt(location) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user