Skip to content

Commit

Permalink
Block Drop Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueDarkLord committed Aug 12, 2024
1 parent eb5f020 commit 8132ddc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ private void blockDropItems(@NotNull Player player, @NotNull Block block, @NotNu
BlockDropItemEvent event = new BlockDropItemEvent(block, block.getState(), player, dropItems);
this.plugin.getServer().getPluginManager().callEvent(event);

// If cancelled, removes the blocks as they should have never been there.
// This mimics the method that the base server uses.
if (event.isCancelled()) dropItems.forEach(Entity::remove);

}

/**
Expand Down

0 comments on commit 8132ddc

Please sign in to comment.