Updated FabledSkyblock integration
This commit is contained in:
@@ -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")) {
|
||||
@@ -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")) {
|
||||
@@ -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")) {
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
BIN
lib/fabledskyblock3.jar
Normal file
BIN
lib/fabledskyblock3.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user