mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 11:45:31 +01:00
Added IslandsManager#getIslandCount(World)
This commit is contained in:
parent
16d1860f5f
commit
260410a927
@ -253,10 +253,14 @@ public class IslandsManager {
|
||||
}
|
||||
}
|
||||
|
||||
public int getIslandCount(){
|
||||
public int getIslandCount() {
|
||||
return islandCache.size();
|
||||
}
|
||||
|
||||
public int getIslandCount(World world) {
|
||||
return islandCache.size(world);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the island for this player. If they are in a team, the team island is returned.
|
||||
* @param world - world to check
|
||||
|
@ -195,6 +195,15 @@ public class IslandCache {
|
||||
return islandsByLocation.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of islands in the cache for this world
|
||||
* @param world
|
||||
* @return the number of islands
|
||||
*/
|
||||
public int size(World world) {
|
||||
return islandsByUUID.getOrDefault(world, new HashMap<>(0)).size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an island owner. Clears out any other owner
|
||||
* @param island - island
|
||||
|
Loading…
Reference in New Issue
Block a user