Skip to content

Commit

Permalink
Fixed IridiumSkyblock
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Mar 29, 2024
1 parent 9bd5cb5 commit af64088
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
block: Block
): Boolean {
val api = IridiumSkyblockAPI.getInstance()
val api = IridiumSkyblockAPI.getInstance() ?: return false

return api.getIslandPermission(api.getIslandViaLocation(block.location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_BREAK)
}
Expand All @@ -22,7 +22,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
location: Location
): Boolean {
val api = IridiumSkyblockAPI.getInstance()
val api = IridiumSkyblockAPI.getInstance() ?: return false

return api.getIslandPermission(api.getIslandViaLocation(location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_BREAK)
}
Expand All @@ -31,7 +31,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
block: Block
): Boolean {
val api = IridiumSkyblockAPI.getInstance()
val api = IridiumSkyblockAPI.getInstance() ?: return false

return api.getIslandPermission(api.getIslandViaLocation(block.location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_PLACE)
}
Expand All @@ -40,7 +40,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
victim: LivingEntity
): Boolean {
val api = IridiumSkyblockAPI.getInstance()
val api = IridiumSkyblockAPI.getInstance() ?: return false

return when (victim) {
is Player -> api.getIslandViaLocation(victim.location).orElse(null) != null
Expand Down

0 comments on commit af64088

Please sign in to comment.