Skip to content

Commit

Permalink
Updated FabledSkyblock integration
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Oct 16, 2023
1 parent e77c8ab commit 6fdbb2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package com.willfp.eco.internal.spigot.integrations.antigrief

import com.songoda.skyblock.SkyBlock
import com.craftaro.skyblock.SkyBlock
import com.willfp.eco.core.integrations.antigrief.AntigriefIntegration
import org.bukkit.Location
import org.bukkit.block.Block
import org.bukkit.entity.LivingEntity
import org.bukkit.entity.Monster
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin

class AntigriefFabledSkyBlock : AntigriefIntegration {
private val skyblock = JavaPlugin.getPlugin(SkyBlock::class.java)

override fun getPluginName(): String {
return "FabledSkyBlock"
}

override fun canBreakBlock(player: Player, block: Block): Boolean {
val skyblock = SkyBlock.getInstance()
val island = skyblock.islandManager.getIslandAtLocation(block.location) ?: return true

if (player.hasPermission("fabledskyblock.bypass.destroy")) {
Expand All @@ -29,7 +31,6 @@ class AntigriefFabledSkyBlock : AntigriefIntegration {
}

override fun canCreateExplosion(player: Player, location: Location): Boolean {
val skyblock = SkyBlock.getInstance()
val island = skyblock.islandManager.getIslandAtLocation(location) ?: return true

if (player.hasPermission("fabledskyblock.bypass.explosions")) {
Expand All @@ -44,7 +45,6 @@ class AntigriefFabledSkyBlock : AntigriefIntegration {
}

override fun canPlaceBlock(player: Player, block: Block): Boolean {
val skyblock = SkyBlock.getInstance()
val island = skyblock.islandManager.getIslandAtLocation(block.location) ?: return true

if (player.hasPermission("fabledskyblock.bypass.place")) {
Expand All @@ -59,8 +59,7 @@ class AntigriefFabledSkyBlock : AntigriefIntegration {
}

override fun canInjure(player: Player, victim: LivingEntity): Boolean {
val skyblock = SkyBlock.getInstance()
val island = SkyBlock.getInstance().islandManager.getIslandAtLocation(victim.location) ?: return true
val island = skyblock.islandManager.getIslandAtLocation(victim.location) ?: return true

if (victim is Player) return skyblock.permissionManager.hasPermission(island, "PvP", island.getRole(player))

Expand All @@ -77,8 +76,7 @@ class AntigriefFabledSkyBlock : AntigriefIntegration {
}

override fun canPickupItem(player: Player, location: Location): Boolean {
val skyblock = SkyBlock.getInstance()
val island = SkyBlock.getInstance().islandManager.getIslandAtLocation(location) ?: return true
val island = skyblock.islandManager.getIslandAtLocation(location) ?: return true

if (player.hasPermission("fabledskyblock.bypass.itempickup")) {
return true
Expand Down
Binary file removed lib/FabledSkyblock-2.5.0.jar
Binary file not shown.
Binary file added lib/fabledskyblock3.jar
Binary file not shown.

0 comments on commit 6fdbb2d

Please sign in to comment.