Package com.janboerman.invsee.spigot.api
Interface MainSpectatorInventory
- All Superinterfaces:
Inventory
,Iterable<ItemStack>
,SpectatorInventory<PlayerInventorySlot>
- All Known Subinterfaces:
MainInventory<NMS,
Self>
A spectator inventory that contains all the items of the target player's 'normal' inventory.
This includes the player's armour, items in his crafting grid, and even the item on his cursor!
-
Method Summary
Modifier and TypeMethodDescriptionGet the items in the player's armour slots.Get the item that is on the player's cursor.default Mirror
<PlayerInventorySlot> Get the mirror this inventory is viewed through.Get the items in the player's offhand.Get the items that are in the player's crafting slots.int
Get the length of thegetPersonalContents()
array.Get the items in the player's storage slots.void
setArmourContents
(ItemStack[] armourContents) Change the items in the player's armour slots.default void
setContents
(MainSpectatorInventory newContents) Set the contents of this inventory based on the contents from the provided inventory.void
setCursorContents
(ItemStack cursor) Set the item that is on the player's cursor.void
setOffHandContents
(ItemStack[] offHand) Set the items in the player's offhand.void
setPersonalContents
(ItemStack[] craftingContents) Set the items that are in the player's crafting slots.void
setStorageContents
(ItemStack[] storageContents) Set the items in the player's storage slots.Methods inherited from interface org.bukkit.inventory.Inventory
addItem, all, all, clear, clear, close, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getHolder, getHolder, getItem, getLocation, getMaxStackSize, getSize, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, removeItemAnySlot, setContents, setItem, setMaxStackSize
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.janboerman.invsee.spigot.api.SpectatorInventory
getCreationOptions, getSpectatedPlayerId, getSpectatedPlayerName, getTitle
-
Method Details
-
getStorageContents
ItemStack[] getStorageContents()Get the items in the player's storage slots.- Specified by:
getStorageContents
in interfaceInventory
-
setStorageContents
Set the items in the player's storage slots.- Specified by:
setStorageContents
in interfaceInventory
-
getArmourContents
ItemStack[] getArmourContents()Get the items in the player's armour slots. -
setArmourContents
Change the items in the player's armour slots. -
getOffHandContents
ItemStack[] getOffHandContents()Get the items in the player's offhand. The length of array is usually 1. -
setOffHandContents
Set the items in the player's offhand. The length of this array must be equal togetOffHandContents().length
. -
setCursorContents
Set the item that is on the player's cursor. -
getCursorContents
ItemStack getCursorContents()Get the item that is on the player's cursor. -
setPersonalContents
Set the items that are in the player's crafting slots. If the target player has an anvil/crafting table/enchanting table/villager workstation opened, then the contents of that temporary container will be updated instead. -
getPersonalContents
ItemStack[] getPersonalContents()Get the items that are in the player's crafting slots. If the target player has an anvil/crafting/table/enchanting table/villager workstation opened, then the contents of that temporary container will be retrieved instead. -
getPersonalContentsSize
int getPersonalContentsSize()Get the length of thegetPersonalContents()
array. -
getMirror
Get the mirror this inventory is viewed through.- Specified by:
getMirror
in interfaceSpectatorInventory<PlayerInventorySlot>
-
setContents
Set the contents of this inventory based on the contents from the provided inventory.
-