mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
This should work (#4234)
This commit is contained in:
parent
2fd0f8a0d8
commit
7d4ed2b335
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user