use of net.silentchaos512.lib.collection.ItemStackList in project SilentGems by SilentChaos512.
the class BaublesCompat method getBaubles.
public static ItemStackList getBaubles(EntityPlayer player, Predicate<ItemStack> predicate) {
ItemStackList list = ItemStackList.create();
if (!MOD_LOADED)
return list;
IBaublesItemHandler inv = BaublesApi.getBaublesHandler(player);
for (int i = 0; i < inv.getSlots(); ++i) {
ItemStack stack = inv.getStackInSlot(i);
if (StackHelper.isValid(stack) && predicate.apply(stack)) {
list.add(stack);
}
}
return list;
}
Aggregations