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 6fe1174e4f..6d9dcaa14b 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 @@ -160,6 +160,11 @@ private void breakBlock(BlockBreakEvent e, Player p, ItemStack item, Block b, Li SlimefunItem sfItem = BlockStorage.check(b); if (sfItem != null && !sfItem.useVanillaBlockBreaking()) { + // Fixes #4037 + if (Slimefun.getTickerTask().isDeletedSoon(b.getLocation())) { + return; + } + /* * Fixes #2989 * We create a dummy here to pass onto the BlockBreakHandler. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java index 1549070714..4fcc9c070e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java @@ -196,6 +196,11 @@ private void callBlockHandler(BlockBreakEvent e, ItemStack item, List } if (sfItem != null && !sfItem.useVanillaBlockBreaking()) { + // Fixes #4037 + if (Slimefun.getTickerTask().isDeletedSoon(e.getBlock().getLocation()) || !BlockStorage.hasBlockInfo(e.getBlock())) { + return; + } + sfItem.callItemHandler(BlockBreakHandler.class, handler -> handler.onPlayerBreak(e, item, drops)); if (e.isCancelled()) { @@ -231,7 +236,7 @@ private void dropItems(BlockBreakEvent e, List drops) { // Disable normal block drops e.setDropItems(false); - // Fix #3182 - Drop the sensitive blocks that require supporting block but don't drop the supporting block + // Fixes #3182 - Drop the sensitive blocks that require supporting block but don't drop the supporting block e.getBlock().setType(Material.AIR, true); for (ItemStack drop : drops) {