Skip empty spots in Loot Tracker when getting items

Skip all empty spots in ItemContainer#getItems array by checking if
itemId > 0.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-10-05 19:19:10 +02:00
parent 2c29924891
commit 21f8883b72

View File

@@ -204,6 +204,7 @@ public class LootTrackerPlugin extends Plugin
// Convert container items to array of ItemStack
final Collection<ItemStack> items = Arrays.stream(container.getItems())
.filter(item -> item.getId() > 0)
.map(item -> new ItemStack(item.getId(), item.getQuantity()))
.collect(Collectors.toList());