| Modifier and Type | Field and Description |
|---|---|
java.util.function.BiFunction<java.lang.Integer,Item,java.lang.Boolean> |
isItemValidForSlot |
| Constructor and Description |
|---|
InventorySimple() |
InventorySimple(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearChanged()
Marks this inventory as unchanged
|
java.util.Optional<Item> |
get(int slot) |
boolean |
hasChanged()
Tells if this inventory has changed since last
invocation of
clearChanged() |
void |
load(Data data)
Loads all the data for this object.
|
void |
markChanged()
Tells this inventory that something has changed
|
void |
read(Packet packet)
Reads a packet.
|
java.util.Optional<Item> |
remove(int slot)
Removes a one count of the item from a slot.
|
void |
save(Data data)
Saves all the data of this object.
|
boolean |
set(int slot,
Item item)
Sets
Item in slot |
int |
size()
Gets count of slots
|
java.util.Optional<Item> |
swap(int slot,
Item item) |
void |
write(Packet packet)
Writes a packet based on the arguments.
|
getID, getProvider, onProviderChangeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, iterator, remove, remove, spliterator, stream, toList, toSetsameTypepublic java.util.function.BiFunction<java.lang.Integer,Item,java.lang.Boolean> isItemValidForSlot
public InventorySimple()
public InventorySimple(int size)
public boolean hasChanged()
clearChanged()public void markChanged()
InventorymarkChanged in interface Inventorypublic void clearChanged()
public int size()
Inventorypublic boolean set(int slot,
Item item)
InventoryItem in slotpublic java.util.Optional<Item> remove(int slot)
Inventory