Skip to content

Commit

Permalink
also fix Slimefun#4037
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 committed Jun 2, 2024
1 parent edf5884 commit cb1fa36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ private void breakBlock(BlockBreakEvent e, Player p, ItemStack item, Block b, Li
SlimefunItem sfItem = BlockStorage.check(b);

if (sfItem != null && !sfItem.useVanillaBlockBreaking()) {
// Fixes #4037
if (Slimefun.getTickerTask().isDeletedSoon(b.getLocation())) {
return;
}

/*
* Fixes #2989
* We create a dummy here to pass onto the BlockBreakHandler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ private void callBlockHandler(BlockBreakEvent e, ItemStack item, List<ItemStack>
}

if (sfItem != null && !sfItem.useVanillaBlockBreaking()) {
// Fixes #4037
if (Slimefun.getTickerTask().isDeletedSoon(e.getBlock().getLocation()) || !BlockStorage.hasBlockInfo(e.getBlock())) {
return;
}

sfItem.callItemHandler(BlockBreakHandler.class, handler -> handler.onPlayerBreak(e, item, drops));

if (e.isCancelled()) {
Expand Down Expand Up @@ -231,7 +236,7 @@ private void dropItems(BlockBreakEvent e, List<ItemStack> drops) {
// Disable normal block drops
e.setDropItems(false);

// Fix #3182 - Drop the sensitive blocks that require supporting block but don't drop the supporting block
// Fixes #3182 - Drop the sensitive blocks that require supporting block but don't drop the supporting block
e.getBlock().setType(Material.AIR, true);

for (ItemStack drop : drops) {
Expand Down

0 comments on commit cb1fa36

Please sign in to comment.