From b38743d713a8d972d0c996c2545166940e49fa5d Mon Sep 17 00:00:00 2001 From: Alessio Colombo Date: Sat, 9 Dec 2023 18:36:00 +0100 Subject: [PATCH] More comments --- .../slimefun4/implementation/listeners/BlockListener.java | 2 ++ 1 file changed, 2 insertions(+) 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 60b44b3ab..91fb9eb29 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 @@ -307,6 +307,7 @@ public class BlockListener implements Listener { } BlockState state = block.getState(); + // We set the block to air to make use of BlockData#isSupported. block.setType(Material.AIR, false); for (BlockFace face : CARDINAL_BLOCKFACES) { if (!isSupported(block.getRelative(face).getBlockData(), block.getRelative(face))) { @@ -319,6 +320,7 @@ public class BlockListener implements Listener { checkForSensitiveBlocks(relative, ++count, isDropItems); } } + // Set the BlockData back: this makes it so containers and spawners drop correctly. This is a hacky fix. block.setBlockData(state.getBlockData(), false); state.update(true, false); }