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 Type
    Method
    Description
    default 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
    Used to close the player's currently open inventory.
    default boolean
    Used to determine if this player is inside of a Menu
    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.
    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 this PlayerInventory
    • build

      default I build(MenuPlayer player, Menu menu)
      Builds an inventory object from a menu.
      Parameters:
      menu - The menu to build.
      Returns:
      The built inventory.
    • build

      I build(MenuPlayer player, Menu menu, int page)
      Builds an inventory object from a menu.
      Parameters:
      player - The player that is opening the menu.
      menu - The menu to build.
      page - The page to use during the build.
      Returns:
      The built inventory.
    • openInventory

      void openInventory(I inventory)
      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 a Menu
      Returns:
      True if this player is inside the specified menu, otherwise false.
    • openMenu

      default void openMenu(MenuPlayer player, Menu menu)
      Used to open the provided menu for this player.
      Parameters:
      player - The menu player.
      menu - The menu to open.
    • openMenu

      default void openMenu(MenuPlayer player, Menu menu, int page)
      Used to open the provided menu for this player on the specified page.
      Parameters:
      player - The menu player.
      menu - The menu to open.
      page - The page to open.
    • openMenu

      default void openMenu(MenuPlayer player, String menu)
      Used to open the provided menu for this player.
      Parameters:
      player - The menu player.
      menu - The menu to open.
    • openMenu

      default void openMenu(MenuPlayer player, String menu, int page)
      Used to open the provided menu for this player on the specified page.
      Parameters:
      player - The menu player.
      menu - The menu to open.
      page - The page to open.
    • 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.