Interface PlayerInventory<I>
- Type Parameters:
I
- Represents the platform's Inventory object.
- All Known Implementing Classes:
BukkitInventory
,FoliaInventory
,PaperInventory
,SpongeInventory
public interface PlayerInventory<I>
A class that acts as a bridge between various inventory objects on different server software providers.
- Since:
- 1.0.0
- Author:
- creatorfromhell
-
Method Summary
Modifier and TypeMethodDescriptiondefault I
build
(MenuPlayer player, Menu menu) Builds an inventory object from a menu.build
(MenuPlayer player, Menu menu, int page) Builds an inventory object from a menu.void
close()
Used to close the player's currently open inventory.default boolean
inMenu()
Used to determine if this player is inside of aMenu
void
openInventory
(I inventory) Used to open the provided inventory for this player.default void
openMenu
(MenuPlayer player, String menu) Used to open the provided menu for this player.default void
openMenu
(MenuPlayer player, String menu, int page) Used to open the provided menu for this player on the specified page.default void
openMenu
(MenuPlayer player, Menu menu) Used to open the provided menu for this player.default void
openMenu
(MenuPlayer player, Menu menu, int page) Used to open the provided menu for this player on the specified page.player()
The player associated with this inventory provider.void
updateInventory
(int slot, net.tnemc.item.AbstractItemStack<?> item) Used to update the menu the player is in with a new item for a specific slot.
-
Method Details
-
player
UUID player()The player associated with this inventory provider.- Returns:
- The
UUID
for the player for thisPlayerInventory
-
openInventory
Used to open the provided inventory for this player.- Parameters:
inventory
- The inventory to open.
-
inMenu
default boolean inMenu()Used to determine if this player is inside of aMenu
- Returns:
- True if this player is inside the specified menu, otherwise false.
-
updateInventory
void updateInventory(int slot, net.tnemc.item.AbstractItemStack<?> item) Used to update the menu the player is in with a new item for a specific slot.- Parameters:
slot
- The slot to update.item
- The item to update the specified slot with.
-
close
void close()Used to close the player's currently open inventory.
-