diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java index db990c64c9..9f71e881d9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java @@ -6,6 +6,7 @@ import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; +import dev.lone.itemsadder.api.CustomBlock; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.Material; @@ -35,9 +36,9 @@ /** * This {@link SlimefunItem} is a super class for items like the {@link ExplosivePickaxe} or {@link ExplosiveShovel}. - * + * * @author TheBusyBiscuit - * + * * @see ExplosivePickaxe * @see ExplosiveShovel * @@ -83,6 +84,10 @@ private void breakBlocks(BlockBreakEvent e, Player p, ItemStack item, Block b, L if (!blockExplodeEvent.isCancelled()) { for (Block block : blockExplodeEvent.blockList()) { if (canBreak(p, block)) { + if (CustomBlock.byAlreadyPlaced(block) != null) { + drops.addAll(CustomBlock.byAlreadyPlaced(block).getLoot()); + CustomBlock.remove(block.getLocation()); + } blocksToDestroy.add(block); } } @@ -90,6 +95,10 @@ private void breakBlocks(BlockBreakEvent e, Player p, ItemStack item, Block b, L } else { for (Block block : blocks) { if (canBreak(p, block)) { + if (CustomBlock.byAlreadyPlaced(block) != null) { + drops.addAll(CustomBlock.byAlreadyPlaced(block).getLoot()); + CustomBlock.remove(block.getLocation()); + } blocksToDestroy.add(block); } } @@ -137,8 +146,6 @@ protected boolean canBreak(@Nonnull Player p, @Nonnull Block b) { return false; } else if (!b.getWorld().getWorldBorder().isInside(b.getLocation())) { return false; - } else if (Slimefun.getIntegrations().isCustomBlock(b)) { - return false; } else { return Slimefun.getProtectionManager().hasPermission(p, b.getLocation(), Interaction.BREAK_BLOCK); }