public abstract class AbstractInventory extends java.lang.Object implements IInventory
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<java.util.function.BiConsumer<IInventory,java.lang.Integer>> |
callbacks |
| Constructor and Description |
|---|
AbstractInventory() |
| Modifier and Type | Method and 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) |
void |
fillRandomly(java.util.Random random,
java.util.List<ItemInstance> items) |
int |
getItemIndex(ItemInstance inst) |
java.util.Iterator<ItemInstance> |
iterator() |
void |
notifyChange(int slot) |
ItemInstance |
remove(int id,
int amount) |
void |
removeChangeCallback(java.util.function.BiConsumer<IInventory,java.lang.Integer> callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsInv, get, getActualSlot, getSlotAmount, setprotected final java.util.Set<java.util.function.BiConsumer<IInventory,java.lang.Integer>> callbacks
public ItemInstance add(int id, int amount)
add in interface IInventorypublic ItemInstance remove(int id, int amount)
remove 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 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 IInventorypublic boolean containsItem(ItemInstance inst)
containsItem in interface IInventorypublic int getItemIndex(ItemInstance inst)
getItemIndex in interface IInventorypublic boolean containsResource(IUseInfo info)
containsResource in interface IInventorypublic java.util.Iterator<ItemInstance> iterator()
iterator in interface java.lang.Iterable<ItemInstance>