public interface IItemSource
| Modifier and Type | Method and Description |
|---|---|
static IItemSource |
fromInventory(IInventory inv)
Construct an IItemSource from given inventory
|
static IItemSource |
fromPlayer(EntityPlayerMP player)
Construct an IItemSource from inventories associated with given player.
|
Map<ItemStack,Integer> |
take(Predicate<ItemStack> predicate,
boolean simulate,
int count)
We are probably not going to need to get a lot of items from this method,
so I don't care about the overhead of storing all fetched items even if downstream code doesn't need it
|
default boolean |
takeAll(ItemStack stack,
boolean simulate)
Take some item.
|
default boolean |
takeAll(Predicate<ItemStack> predicate,
boolean simulate,
int count)
Take exactly count amount of items matching predicate.
|
default boolean |
takeOne(ItemStack stack,
boolean simulate)
Take exactly one item.
|
default ItemStack |
takeOne(Predicate<ItemStack> predicate,
boolean simulate)
Take exactly one item that matches the predicate.
|
@Nonnull Map<ItemStack,Integer> take(Predicate<ItemStack> predicate, boolean simulate, int count)
default ItemStack takeOne(Predicate<ItemStack> predicate, boolean simulate)
default boolean takeAll(Predicate<ItemStack> predicate, boolean simulate, int count)
default boolean takeOne(ItemStack stack, boolean simulate)
default boolean takeAll(ItemStack stack, boolean simulate)
static IItemSource fromPlayer(EntityPlayerMP player)
This will be backed by InventoryUtility
static IItemSource fromInventory(IInventory inv)
This will be backed by InventoryUtility