Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sfiguz7 committed Dec 9, 2023
1 parent b3ff154 commit b38743d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ private void checkForSensitiveBlocks(Block block, Integer count, boolean isDropI
}

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))) {
Expand All @@ -319,6 +320,7 @@ private void checkForSensitiveBlocks(Block block, Integer count, boolean isDropI
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);
}
Expand Down

0 comments on commit b38743d

Please sign in to comment.