Class SpongeInventory

java.lang.Object
net.tnemc.menu.sponge8.SpongeInventory
All Implemented Interfaces:
PlayerInventory<org.spongepowered.api.item.inventory.Inventory>

public class SpongeInventory extends Object implements PlayerInventory<org.spongepowered.api.item.inventory.Inventory>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.spongepowered.plugin.PluginContainer
     
    protected final UUID
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpongeInventory(UUID id, org.spongepowered.plugin.PluginContainer container)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.spongepowered.api.item.inventory.Inventory
    build(MenuPlayer player, Menu menu, int page)
    Builds an inventory object from a menu.
    void
    Used to close the player's currently open inventory.
    void
    openInventory(org.spongepowered.api.item.inventory.Inventory inventory)
    Used to open the provided inventory for this 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.tnemc.menu.core.compatibility.PlayerInventory

    build, inMenu, openMenu, openMenu, openMenu, openMenu
  • Field Details

    • id

      protected final UUID id
    • container

      protected final org.spongepowered.plugin.PluginContainer container
  • Constructor Details

    • SpongeInventory

      public SpongeInventory(UUID id, org.spongepowered.plugin.PluginContainer container)
  • Method Details

    • player

      public UUID player()
      The player associated with this inventory provider.
      Specified by:
      player in interface PlayerInventory<org.spongepowered.api.item.inventory.Inventory>
      Returns:
      The UUID for the player for this PlayerInventory
    • build

      public org.spongepowered.api.item.inventory.Inventory build(MenuPlayer player, Menu menu, int page)
      Builds an inventory object from a menu.
      Specified by:
      build in interface PlayerInventory<org.spongepowered.api.item.inventory.Inventory>
      Parameters:
      menu - The menu to build.
      page - The page to use during the build.
      player - The player that is opening the menu.
      Returns:
      The built inventory.
    • openInventory

      public void openInventory(org.spongepowered.api.item.inventory.Inventory inventory)
      Used to open the provided inventory for this player.
      Specified by:
      openInventory in interface PlayerInventory<org.spongepowered.api.item.inventory.Inventory>
      Parameters:
      inventory - The inventory to open.
    • updateInventory

      public 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.
      Specified by:
      updateInventory in interface PlayerInventory<org.spongepowered.api.item.inventory.Inventory>
      Parameters:
      slot - The slot to update.
      item - The item to update the specified slot with.
    • close

      public void close()
      Used to close the player's currently open inventory.
      Specified by:
      close in interface PlayerInventory<org.spongepowered.api.item.inventory.Inventory>