Added IslandsManager#getIslandCount(World)

This commit is contained in:
Florian CUNY 2018-12-09 14:19:26 +01:00
parent 16d1860f5f
commit 260410a927
2 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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