From 7d4ed2b3353e4121b6262ddb3c5959d1ec657e00 Mon Sep 17 00:00:00 2001 From: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:37:06 -0500 Subject: [PATCH] This should work (#4234) --- .../slimefun4/implementation/listeners/BlockListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 12937e45a..41d09759a 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 @@ -70,18 +70,18 @@ public class BlockListener implements Listener { Block block = e.getBlock(); // Fixes #2636 - This will solve the "ghost blocks" issue - if (e.getBlockReplacedState().getType().isAir()) { + if (e.getBlockReplacedState().getType().isAir() && BlockStorage.hasBlockInfo(block) && !Slimefun.getTickerTask().isDeletedSoon(block.getLocation())) { SlimefunItem sfItem = BlockStorage.check(block); - if (sfItem != null && !Slimefun.getTickerTask().isDeletedSoon(block.getLocation())) { + if (sfItem != null) { for (ItemStack item : sfItem.getDrops()) { if (item != null && !item.getType().isAir()) { block.getWorld().dropItemNaturally(block.getLocation(), item); } } - - BlockStorage.clearBlockInfo(block); } + + BlockStorage.clearBlockInfo(block); } else if (BlockStorage.hasBlockInfo(e.getBlock())) { // If there is no air (e.g. grass) then don't let the block be placed e.setCancelled(true);