1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

More comments

This commit is contained in:
Alessio Colombo 2023-12-09 18:36:00 +01:00
parent b3ff154f24
commit b38743d713

View File

@ -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);
}