类 InventoryGui

java.lang.Object
cn.afternode.commons.bukkit.gui.InventoryGui
所有已实现的接口:
IGui

public class InventoryGui extends Object implements IGui
  • 构造器概要

    构造器
    构造器
    说明
    Create new chest GUI with default size and title
    InventoryGui(int size)
    Create new chest GUI with specified size
    InventoryGui(int size, net.kyori.adventure.text.Component title)
    Create new chest GUI with specified size and title
    InventoryGui(net.kyori.adventure.text.Component title)
    Create new chest GUi with specified title
  • 方法概要

    修饰符和类型
    方法
    说明
    org.bukkit.inventory.Inventory
    createInventory(org.bukkit.entity.Player holder)
    Create new inventory with specified owner
    void
    Set a slot that does not block operations
    int
    Get current size
    net.kyori.adventure.text.Component
    Get current inventory title
    boolean
    Get if a slot does not block operations
    boolean
    onSlotClick(org.bukkit.entity.Player who, org.bukkit.event.inventory.InventoryClickEvent event, OpenedGui gui)
    Click handler
    void
    putCallback(int slot, GuiClickCallback callback)
    Set click callback in specified slot
    void
    putItem(int slot, org.bukkit.inventory.ItemStack stack)
    Put item in specified slot
    void
    setSize(int size)
    Set maximum size (may reset contents in current instance)
    void
    setTitle(net.kyori.adventure.text.Component component)
    Set inventory title

    从类继承的方法 java.lang.Object

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

    从接口继承的方法 cn.afternode.commons.bukkit.gui.IGui

    callbackItem, fill
  • 构造器详细资料

    • InventoryGui

      public InventoryGui(int size, net.kyori.adventure.text.Component title)
      Create new chest GUI with specified size and title
      参数:
      size - size
      title - title
    • InventoryGui

      public InventoryGui(int size)
      Create new chest GUI with specified size
      参数:
      size - size
    • InventoryGui

      public InventoryGui(net.kyori.adventure.text.Component title)
      Create new chest GUi with specified title
      参数:
      title - title
    • InventoryGui

      public InventoryGui()
      Create new chest GUI with default size and title
  • 方法详细资料

    • putItem

      public void putItem(int slot, org.bukkit.inventory.ItemStack stack)
      从接口复制的说明: IGui
      Put item in specified slot
      指定者:
      putItem 在接口中 IGui
      参数:
      slot - slot number
      stack - item
    • putCallback

      public void putCallback(int slot, GuiClickCallback callback)
      从接口复制的说明: IGui
      Set click callback in specified slot
      指定者:
      putCallback 在接口中 IGui
      参数:
      slot - slot number
      callback - callback
    • dontBlockOperation

      public void dontBlockOperation(int slot)
      从接口复制的说明: IGui
      Set a slot that does not block operations
      指定者:
      dontBlockOperation 在接口中 IGui
      参数:
      slot - Target slot number
    • isDontBlockOperation

      public boolean isDontBlockOperation(int slot)
      从接口复制的说明: IGui
      Get if a slot does not block operations
      指定者:
      isDontBlockOperation 在接口中 IGui
      参数:
      slot - Target slot number
      返回:
      result
    • setTitle

      public void setTitle(net.kyori.adventure.text.Component component)
      从接口复制的说明: IGui
      Set inventory title
      指定者:
      setTitle 在接口中 IGui
      参数:
      component - title
    • getTitle

      public net.kyori.adventure.text.Component getTitle()
      从接口复制的说明: IGui
      Get current inventory title
      指定者:
      getTitle 在接口中 IGui
      返回:
      title
    • setSize

      public void setSize(int size)
      从接口复制的说明: IGui
      Set maximum size (may reset contents in current instance)
      指定者:
      setSize 在接口中 IGui
      参数:
      size - Target size
    • getSize

      public int getSize()
      从接口复制的说明: IGui
      Get current size
      指定者:
      getSize 在接口中 IGui
      返回:
      size
    • createInventory

      public org.bukkit.inventory.Inventory createInventory(org.bukkit.entity.Player holder)
      从接口复制的说明: IGui
      Create new inventory with specified owner
      指定者:
      createInventory 在接口中 IGui
      参数:
      holder - owner
      返回:
      created
    • onSlotClick

      public boolean onSlotClick(org.bukkit.entity.Player who, org.bukkit.event.inventory.InventoryClickEvent event, OpenedGui gui)
      从接口复制的说明: IGui
      Click handler
      指定者:
      onSlotClick 在接口中 IGui
      参数:
      who - Who clicked
      event - Click event
      gui - Opened GUI data
      返回:
      If event cancellation needed