Small internal code change for CustomCrops compatibility

This commit is contained in:
ceze88 2024-03-20 12:34:00 +01:00
parent cc27a5744c
commit a75a4eae2d
1 changed files with 6 additions and 2 deletions

View File

@ -255,18 +255,22 @@ public class Island {
}
/**
* @return The IslandRole of a player
* @return The IslandRole of a player or Visitor if not found
*/
public IslandRole getRole(OfflinePlayer player) {
Preconditions.checkArgument(player != null, "Cannot get role for null player");
if (isCoopPlayer(player.getUniqueId())) {
return IslandRole.COOP;
}
for (com.craftaro.skyblock.island.IslandRole role : com.craftaro.skyblock.island.IslandRole.values()) {
if (this.handle.hasRole(role, player.getUniqueId())) {
return APIUtil.fromImplementation(role);
}
}
return null;
return IslandRole.VISITOR;
}
/**