IInventorypublic class CombinedInventory extends java.lang.Object implements IInventory
| Constructor | Description |
|---|---|
CombinedInventory(IInventory... inventories) |
| Modifier and Type | Method | Description |
|---|---|---|
ItemInstance |
add(int id,
int amount) |
|
ItemInstance |
add(ItemInstance instance,
boolean simulate) |
|
void |
addChangeCallback(java.util.function.BiConsumer<IInventory,java.lang.Integer> callback) |
|
ItemInstance |
addExistingFirst(ItemInstance instance,
boolean simulate) |
|
ItemInstance |
addToSlot(int slot,
ItemInstance instance,
boolean simulate) |
|
boolean |
containsItem(ItemInstance inst) |
|
boolean |
containsResource(IUseInfo info) |
|
<T> T |
executeOnInv(int id,
java.util.function.BiFunction<IInventory,java.lang.Integer,T> function) |
|
void |
fillRandomly(java.util.Random random,
java.util.List<ItemInstance> items) |
|
ItemInstance |
get(int id) |
|
int |
getItemIndex(ItemInstance inst) |
|
int |
getSlotAmount() |
|
void |
notifyChange(int slot) |
|
ItemInstance |
remove(int id,
int amount) |
|
void |
removeChangeCallback(java.util.function.BiConsumer<IInventory,java.lang.Integer> callback) |
|
void |
set(int id,
ItemInstance instance) |
public CombinedInventory(IInventory... inventories)
public void set(int id,
ItemInstance instance)
set in interface IInventorypublic <T> T executeOnInv(int id,
java.util.function.BiFunction<IInventory,java.lang.Integer,T> function)
public ItemInstance add(int id, int amount)
add in interface IInventorypublic ItemInstance remove(int id, int amount)
remove in interface IInventorypublic ItemInstance get(int id)
get in interface IInventorypublic int getSlotAmount()
getSlotAmount in interface IInventorypublic void notifyChange(int slot)
notifyChange in interface IInventorypublic void addChangeCallback(java.util.function.BiConsumer<IInventory,java.lang.Integer> callback)
addChangeCallback in interface IInventorypublic void removeChangeCallback(java.util.function.BiConsumer<IInventory,java.lang.Integer> callback)
removeChangeCallback in interface IInventorypublic ItemInstance addToSlot(int slot, ItemInstance instance, boolean simulate)
addToSlot in interface IInventorypublic boolean containsResource(IUseInfo info)
containsResource in interface IInventorypublic boolean containsItem(ItemInstance inst)
containsItem in interface IInventorypublic int getItemIndex(ItemInstance inst)
getItemIndex in interface IInventorypublic ItemInstance add(ItemInstance instance, boolean simulate)
add in interface IInventorypublic ItemInstance addExistingFirst(ItemInstance instance, boolean simulate)
addExistingFirst in interface IInventorypublic void fillRandomly(java.util.Random random,
java.util.List<ItemInstance> items)
fillRandomly in interface IInventory