Class BukkitInventory

java.lang.Object
net.tnemc.menu.bukkit.BukkitInventory
All Implemented Interfaces:
PlayerInventory<org.bukkit.inventory.Inventory>

public class BukkitInventory extends Object implements PlayerInventory<org.bukkit.inventory.Inventory>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final UUID
     
    protected final org.bukkit.plugin.java.JavaPlugin
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BukkitInventory(UUID id, org.bukkit.plugin.java.JavaPlugin plugin)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.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.bukkit.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 inventory 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
    • plugin

      protected final org.bukkit.plugin.java.JavaPlugin plugin
  • Constructor Details

    • BukkitInventory

      public BukkitInventory(UUID id, org.bukkit.plugin.java.JavaPlugin plugin)
  • Method Details

    • player

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

      public org.bukkit.inventory.Inventory build(MenuPlayer player, Menu menu, int page)
      Builds an inventory object from a menu.
      Specified by:
      build in interface PlayerInventory<org.bukkit.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.bukkit.inventory.Inventory inventory)
      Used to open the provided inventory for this player.
      Specified by:
      openInventory in interface PlayerInventory<org.bukkit.inventory.Inventory>
      Parameters:
      inventory - The inventory to open.
    • updateInventory

      public void updateInventory(int slot, net.tnemc.item.AbstractItemStack<?> item)
      Used to update the inventory the player is in with a new item for a specific slot.
      Specified by:
      updateInventory in interface PlayerInventory<org.bukkit.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.bukkit.inventory.Inventory>