public interface Inventory extends java.lang.Iterable<Item>
ItemsInventorySimple,
InventoryView| Modifier and Type | Method and Description |
|---|---|
default int |
add(int slot,
Item stack)
Adds items to this inventory at specified slot
|
default int |
add(Item stack)
Adds items to this inventory
|
java.util.Optional<Item> |
get(int slot) |
default java.util.Iterator<Item> |
iterator() |
void |
markChanged()
Tells this inventory that something has changed
|
java.util.Optional<Item> |
remove(int slot)
Removes a one count of the item from a slot.
|
default java.util.Optional<Item> |
remove(int slot,
int amount)
Removes a certain amount of items from a slot.
|
default java.util.Optional<Item> |
remove(Item check)
Removes a certain item from a slot.
|
boolean |
set(int slot,
Item stack)
Sets
Item in slot |
int |
size()
Gets count of slots
|
default java.util.Spliterator<Item> |
spliterator() |
default java.util.stream.Stream<Item> |
stream()
Represents this inventory as
Item Stream |
default java.util.List<Item> |
toList()
Represents this inventory as list of
Items |
default java.util.Set<Item> |
toSet() |
java.util.Optional<Item> get(int slot)
boolean set(int slot,
Item stack)
Item in slotslot - Slot numberstack - Stack to insertint size()
void markChanged()
default int add(int slot,
Item stack)
slot - Slot to add items intostack - Item containing itemsdefault int add(Item stack)
stack - Item containing itemsjava.util.Optional<Item> remove(int slot)
slot - The slot index to removedefault java.util.Optional<Item> remove(int slot, int amount)
slot - The slot index to removeamount - The amount of items to removedefault java.util.Optional<Item> remove(Item check)
check - The item type to check withdefault java.util.List<Item> toList()
ItemsItemsdefault java.util.Set<Item> toSet()
default java.util.Iterator<Item> iterator()
iterator in interface java.lang.Iterable<Item>default java.util.Spliterator<Item> spliterator()
spliterator in interface java.lang.Iterable<Item>