diff --git a/common/src/main/kotlin/com/artillexstudios/axminions/integrations/island/SuperiorSkyBlock2Integration.kt b/common/src/main/kotlin/com/artillexstudios/axminions/integrations/island/SuperiorSkyBlock2Integration.kt index 7842da4..67fa575 100644 --- a/common/src/main/kotlin/com/artillexstudios/axminions/integrations/island/SuperiorSkyBlock2Integration.kt +++ b/common/src/main/kotlin/com/artillexstudios/axminions/integrations/island/SuperiorSkyBlock2Integration.kt @@ -3,6 +3,7 @@ package com.artillexstudios.axminions.integrations.island import com.artillexstudios.axminions.api.AxMinionsAPI import com.artillexstudios.axminions.api.integrations.types.IslandIntegration import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI +import org.bukkit.block.Block import org.bukkit.entity.Player class SuperiorSkyBlock2Integration : IslandIntegration { @@ -16,6 +17,10 @@ class SuperiorSkyBlock2Integration : IslandIntegration { return placed } + fun handleBlockBreak(block: Block) { + SuperiorSkyblockAPI.getIslandAt(block.location)?.handleBlockBreak(block) + } + override fun register() { } diff --git a/common/src/main/kotlin/com/artillexstudios/axminions/minions/miniontype/MinerMinionType.kt b/common/src/main/kotlin/com/artillexstudios/axminions/minions/miniontype/MinerMinionType.kt index 4fec705..cc51709 100644 --- a/common/src/main/kotlin/com/artillexstudios/axminions/minions/miniontype/MinerMinionType.kt +++ b/common/src/main/kotlin/com/artillexstudios/axminions/minions/miniontype/MinerMinionType.kt @@ -3,12 +3,14 @@ package com.artillexstudios.axminions.minions.miniontype import com.artillexstudios.axapi.scheduler.Scheduler import com.artillexstudios.axapi.scheduler.impl.FoliaScheduler import com.artillexstudios.axminions.AxMinionsPlugin +import com.artillexstudios.axminions.api.AxMinionsAPI import com.artillexstudios.axminions.api.minions.Minion import com.artillexstudios.axminions.api.minions.miniontype.MinionType import com.artillexstudios.axminions.api.utils.LocationUtils import com.artillexstudios.axminions.api.utils.MinionUtils import com.artillexstudios.axminions.api.utils.fastFor import com.artillexstudios.axminions.api.warnings.Warnings +import com.artillexstudios.axminions.integrations.island.SuperiorSkyBlock2Integration import com.artillexstudios.axminions.minions.MinionTicker import com.artillexstudios.axminions.nms.NMSHandler import dev.lone.itemsadder.api.CustomBlock @@ -118,7 +120,11 @@ class MinerMinionType : MinionType("miner", AxMinionsPlugin.INSTANCE.getResource amount += it.amount } minion.addToContainerOrDrop(drops) - location.block.type = Material.AIR + block.type = Material.AIR + val integration = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() + if (integration is SuperiorSkyBlock2Integration) { + integration.handleBlockBreak(block) + } } } } @@ -159,7 +165,11 @@ class MinerMinionType : MinionType("miner", AxMinionsPlugin.INSTANCE.getResource amount += it.amount } minion.addToContainerOrDrop(drops) - location.block.type = Material.AIR + block.type = Material.AIR + val integration = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() + if (integration is SuperiorSkyBlock2Integration) { + integration.handleBlockBreak(block) + } } } } @@ -193,7 +203,11 @@ class MinerMinionType : MinionType("miner", AxMinionsPlugin.INSTANCE.getResource amount += it.amount } minion.addToContainerOrDrop(drops) - location.block.type = Material.AIR + block.type = Material.AIR + val integration = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() + if (integration is SuperiorSkyBlock2Integration) { + integration.handleBlockBreak(block) + } } } } @@ -228,7 +242,11 @@ class MinerMinionType : MinionType("miner", AxMinionsPlugin.INSTANCE.getResource amount += item.amount } minion.addToContainerOrDrop(drops) - location.block.type = Material.AIR + block.type = Material.AIR + val integration = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() + if (integration is SuperiorSkyBlock2Integration) { + integration.handleBlockBreak(block) + } } } } @@ -277,7 +295,11 @@ class MinerMinionType : MinionType("miner", AxMinionsPlugin.INSTANCE.getResource } minion.addToContainerOrDrop(drops) - location.block.type = Material.AIR + block.type = Material.AIR + val integration = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() + if (integration is SuperiorSkyBlock2Integration) { + integration.handleBlockBreak(block) + } } } }