mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-26 05:42:37 +02:00
Added nullability annotations in IslandCache, IslandsManager and Util
This commit is contained in:
parent
d41f35e58d
commit
4e86441f6f
@ -338,6 +338,7 @@ public class IslandsManager {
|
||||
* @param uuid user's uuid
|
||||
* @return Island or null
|
||||
*/
|
||||
@Nullable
|
||||
public Island getIsland(World world, UUID uuid){
|
||||
return islandCache.get(world, uuid);
|
||||
}
|
||||
@ -369,6 +370,7 @@ public class IslandsManager {
|
||||
* @return the islandCache
|
||||
* @since 1.5.0
|
||||
*/
|
||||
@NonNull
|
||||
public IslandCache getIslandCache() {
|
||||
return islandCache;
|
||||
}
|
||||
@ -389,6 +391,7 @@ public class IslandsManager {
|
||||
* @param uuid - the player's UUID
|
||||
* @return Location of player's island or null if one does not exist
|
||||
*/
|
||||
@Nullable
|
||||
public Location getIslandLocation(World world, UUID uuid) {
|
||||
Island island = getIsland(world, uuid);
|
||||
return island != null ? island.getCenter() : null;
|
||||
|
@ -165,7 +165,7 @@ public class IslandCache {
|
||||
* @return set of UUID's of island members. If there is no island, this set will be empty
|
||||
*/
|
||||
@NonNull
|
||||
public Set<UUID> getMembers(@NonNull World world, @NonNull UUID uuid, @NonNull int minimumRank) {
|
||||
public Set<UUID> getMembers(@NonNull World world, @NonNull UUID uuid, int minimumRank) {
|
||||
islandsByUUID.putIfAbsent(Util.getWorld(world), new HashMap<>());
|
||||
Island island = islandsByUUID.get(Util.getWorld(world)).get(uuid);
|
||||
if (island != null) {
|
||||
|
@ -219,6 +219,7 @@ public class Util {
|
||||
* @param world - world
|
||||
* @return over world
|
||||
*/
|
||||
@Nullable
|
||||
public static World getWorld(@Nullable World world) {
|
||||
return world == null ? null : world.getEnvironment().equals(Environment.NORMAL) ? world : Bukkit.getWorld(world.getName().replaceAll(NETHER, "").replaceAll(THE_END, ""));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user