diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java index 41a293a7f3..7644fd7653 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java @@ -13,7 +13,6 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.blocks.Vein; -import io.github.bakedlibs.dough.items.CustomItemStack; import io.github.bakedlibs.dough.protection.Interaction; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; @@ -24,6 +23,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; +import me.mrCookieSlime.Slimefun.api.BlockStorage; /** * The {@link PickaxeOfVeinMining} is a powerful tool which allows you to mine an entire vein of ores @@ -48,14 +48,18 @@ public PickaxeOfVeinMining(ItemGroup itemGroup, SlimefunItemStack item, RecipeTy return (e, tool, fortune, drops) -> { if (SlimefunTag.PICKAXE_OF_VEIN_MINING_BLOCKS.isTagged(e.getBlock().getType())) { List blocks = Vein.find(e.getBlock(), maxBlocks.getValue(), b -> SlimefunTag.PICKAXE_OF_VEIN_MINING_BLOCKS.isTagged(b.getType())); - breakBlocks(e.getPlayer(), blocks, fortune, tool); + breakBlocks(e.getPlayer(), blocks, tool); } }; } @ParametersAreNonnullByDefault - private void breakBlocks(Player p, List blocks, int fortune, ItemStack tool) { + private void breakBlocks(Player p, List blocks, ItemStack tool) { for (Block b : blocks) { + if (BlockStorage.check(b.getLocation()) != null) { + continue; + } + if (Slimefun.getProtectionManager().hasPermission(p, b.getLocation(), Interaction.BREAK_BLOCK)) { b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType()); @@ -63,7 +67,7 @@ private void breakBlocks(Player p, List blocks, int fortune, ItemStack to b.getWorld().dropItemNaturally(b.getLocation(), new ItemStack(b.getType())); } else { for (ItemStack drop : b.getDrops(tool)) { - b.getWorld().dropItemNaturally(b.getLocation(), drop.getType().isBlock() ? drop : CustomItemStack.create(drop, fortune)); + b.getWorld().dropItemNaturally(b.getLocation(), drop); } } @@ -72,4 +76,4 @@ private void breakBlocks(Player p, List blocks, int fortune, ItemStack to } } -} +} \ No newline at end of file