public interface Container extends Interactable
Inventory
objects used to allow players to interact
with the Inventories, usually via a GUI (the View).Inventory.Builder
Modifier and Type | Method and Description |
---|---|
void |
close(Player viewer)
Stops showing this Inventory to the given viewer.
|
Set<Player> |
getViewers()
Gets the current viewers looking at this Inventory.
|
boolean |
hasViewers()
Checks for whether this Inventory currently has viewers.
|
boolean |
isViewedSlot(Slot slot)
Returns whether given slot is part of the viewed inventories
but not part of the viewers own inventory.
|
void |
open(Player viewer)
Shows this Inventory to the given viewer.
|
canInteractWith
builder, canFit, capacity, clear, contains, contains, containsAny, containsInventory, first, getArchetype, getInventoryProperty, getInventoryProperty, getMaxStackSize, getPlugin, getProperties, getProperties, getProperty, getProperty, hasChildren, intersect, next, offer, parent, peek, peek, poll, poll, query, query, query, query, query, query, query, queryAny, root, set, setMaxStackSize, size, slots, totalItems, transform, union
forEach, iterator, spliterator
Set<Player> getViewers()
boolean hasViewers()
void open(Player viewer) throws IllegalArgumentException
viewer
- The viewer to show this inventory toIllegalArgumentException
- if a PluginContainer
is not the root of the causevoid close(Player viewer) throws IllegalArgumentException
viewer
- The viewer to stop showing this inventory toIllegalArgumentException
- if a PluginContainer
is not the root of the causeboolean isViewedSlot(Slot slot)
Examples for viewed inventory slots:
All the slots of the opened chest and not the player grid below.
The slots of the crafting grid in the opened player inventory.
slot
- The slot to check.true
when the slot is part of the viewed inventories.