接口 IGui

所有已知实现类:
InventoryGui

public interface IGui
  • 方法概要

    修饰符和类型
    方法
    说明
    default void
    callbackItem(int slot, org.bukkit.inventory.ItemStack item, GuiClickCallback callback)
    Put item in specified slot with callback
    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
    default void
    fill(int start, int end, org.bukkit.inventory.ItemStack item)
    Fill with specified item
    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
  • 方法详细资料

    • putItem

      void putItem(int slot, org.bukkit.inventory.ItemStack stack)
      Put item in specified slot
      参数:
      slot - slot number
      stack - item
    • putCallback

      void putCallback(int slot, GuiClickCallback callback)
      Set click callback in specified slot
      参数:
      slot - slot number
      callback - callback
    • callbackItem

      default void callbackItem(int slot, org.bukkit.inventory.ItemStack item, GuiClickCallback callback)
      Put item in specified slot with callback
      参数:
      slot - slot number
      item - item
      callback - callback
    • dontBlockOperation

      void dontBlockOperation(int slot)
      Set a slot that does not block operations
      参数:
      slot - Target slot number
    • isDontBlockOperation

      boolean isDontBlockOperation(int slot)
      Get if a slot does not block operations
      参数:
      slot - Target slot number
      返回:
      result
    • setTitle

      void setTitle(net.kyori.adventure.text.Component component)
      Set inventory title
      参数:
      component - title
    • getTitle

      net.kyori.adventure.text.Component getTitle()
      Get current inventory title
      返回:
      title
    • setSize

      void setSize(int size)
      Set maximum size (may reset contents in current instance)
      参数:
      size - Target size
    • getSize

      int getSize()
      Get current size
      返回:
      size
    • fill

      default void fill(int start, int end, org.bukkit.inventory.ItemStack item)
      Fill with specified item
      参数:
      start - start slot
      end - end slot
      item - item
    • createInventory

      org.bukkit.inventory.Inventory createInventory(org.bukkit.entity.Player holder)
      Create new inventory with specified owner
      参数:
      holder - owner
      返回:
      created
    • onSlotClick

      @Internal boolean onSlotClick(org.bukkit.entity.Player who, org.bukkit.event.inventory.InventoryClickEvent event, OpenedGui gui)
      Click handler
      参数:
      who - Who clicked
      event - Click event
      gui - Opened GUI data
      返回:
      If event cancellation needed