Skip to content

Commit

Permalink
fix dropped item limit
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Dec 27, 2023
1 parent 45bf84e commit ad27487
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ private void onItemDrop(ItemSpawnEvent event) {
for (Entity entity : event.getEntity().getChunk().getEntities()) {
if (entity.getType().equals(EntityType.DROPPED_ITEM)) {
count++;
}
if (count > maxDroppedItemsPerChunk) {
if (usingWhitelist && whitelistedItems.contains(event.getEntity().getItemStack().getType())) continue;
entity.getScheduler().run(plugin, kill -> entity.remove(), null);
if (count > maxDroppedItemsPerChunk) {
if (usingWhitelist && whitelistedItems.contains(event.getEntity().getItemStack().getType())) continue;
entity.getScheduler().run(plugin, kill -> entity.remove(), null);
}
}
}
}
Expand Down

0 comments on commit ad27487

Please sign in to comment.