Class OkCancelPage

java.lang.Object
mc.obliviate.inventory.Gui
com.ultikits.ultitools.abstracts.guis.OkCancelPage
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
Direct Known Subclasses:
InventoryConfirm

@Deprecated(since="6.2.0", forRemoval=true) public abstract class OkCancelPage extends mc.obliviate.inventory.Gui
Deprecated, for removal: This API element is subject to removal in a future version.
Use BaseConfirmationPage instead, which provides better template method pattern, builder support, and code organization.

请使用 BaseConfirmationPage, 它提供了更好的模板方法模式、构建器支持和代码组织。

This abstract class represents a GUI page with OK and Cancel options. It extends the Gui class from mc.obliviate.inventory package.

这个抽象类代表了一个带有OK和Cancel选项的GUI页面。它继承了mc.obliviate.inventory包中的Gui类。

Since:
6.2.0 deprecated
See Also:
  • Field Summary

    Fields inherited from class mc.obliviate.inventory.Gui

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    OkCancelPage(@NotNull org.bukkit.entity.Player player, @NotNull String id, String title, int rows)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor with player, id, title and number of rows as parameters.
    OkCancelPage(@NotNull org.bukkit.entity.Player player, @NotNull String id, String title, org.bukkit.event.inventory.InventoryType inventoryType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor with player, id, title and inventory type as parameters.
    OkCancelPage(@NotNull org.bukkit.entity.Player player, @NotNull String id, net.kyori.adventure.text.Component title, int rows)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor with player, id, title component and number of rows as parameters.
    OkCancelPage(@NotNull org.bukkit.entity.Player player, @NotNull String id, net.kyori.adventure.text.Component title, org.bukkit.event.inventory.InventoryType inventoryType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor with player, id, title component and inventory type as parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    abstract void
    onCancel(org.bukkit.event.inventory.InventoryClickEvent clickEvent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is called when the Cancel option is clicked.
    abstract void
    onOk(org.bukkit.event.inventory.InventoryClickEvent clickEvent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is called when the OK option is clicked.
    void
    onOpen(org.bukkit.event.inventory.InventoryOpenEvent event)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method is called when the GUI is opened.

    Methods inherited from class mc.obliviate.inventory.Gui

    addItem, addItem, addItem, addItem, addItem, addItem, addItem, addItem, createInventory, createInventory, fillColumn, fillGui, fillGui, fillGui, fillGui, fillRow, getId, getInventory, getItems, getLastSlot, getPlugin, getSize, getTaskList, getTitle, isClosed, onClick, onClose, onDrag, open, runTaskLater, sendSizeUpdate, sendTitleUpdate, setClosed, setInventory, setSize, setTitle, stopAllTasks, stopTask, updateTask

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OkCancelPage

      public OkCancelPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, String title, int rows)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor with player, id, title and number of rows as parameters.

      构造函数,参数为玩家、id、标题和行数。

      Parameters:
      player - The player who will see the GUI.
      id - The id of the GUI.
      title - The title of the GUI.
      rows - The number of rows in the GUI.
    • OkCancelPage

      public OkCancelPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, String title, org.bukkit.event.inventory.InventoryType inventoryType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor with player, id, title and inventory type as parameters.

      构造函数,参数为玩家、id、标题和背包类型。

      Parameters:
      player - The player who will see the GUI.
      id - The id of the GUI.
      title - The title of the GUI.
      inventoryType - The type of the inventory.
    • OkCancelPage

      public OkCancelPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, net.kyori.adventure.text.Component title, int rows)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor with player, id, title component and number of rows as parameters.

      构造函数,参数为玩家、id、标题组件和行数。

      Parameters:
      player - The player who will see the GUI.
      id - The id of the GUI.
      title - The title of the GUI as a Component.
      rows - The number of rows in the GUI.
    • OkCancelPage

      public OkCancelPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, net.kyori.adventure.text.Component title, org.bukkit.event.inventory.InventoryType inventoryType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor with player, id, title component and inventory type as parameters.

      构造函数,参数为玩家、id、标题组件和背包类型。

      Parameters:
      player - The player who will see the GUI.
      id - The id of the GUI.
      title - The title of the GUI as a Component.
      inventoryType - The type of the inventory.
  • Method Details

    • onOpen

      public void onOpen(org.bukkit.event.inventory.InventoryOpenEvent event)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is called when the GUI is opened. It sets up the OK and Cancel options in the GUI.

      当GUI被打开时调用此方法。此方法在GUI中设置了OK和Cancel选项。

      Overrides:
      onOpen in class mc.obliviate.inventory.Gui
      Parameters:
      event - The InventoryOpenEvent that triggers this method.

      触发此方法的InventoryOpenEvent。

    • getOkName

      public String getOkName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCancelName

      public String getCancelName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onOk

      public abstract void onOk(org.bukkit.event.inventory.InventoryClickEvent clickEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is called when the OK option is clicked. It should be overridden in subclasses to provide specific functionality.

      当点击OK选项时调用此方法。此方法应该在子类中被重写以提供特定的功能。

      Parameters:
      clickEvent - The InventoryClickEvent that triggers this method.

      触发此方法的InventoryClickEvent。

    • onCancel

      public abstract void onCancel(org.bukkit.event.inventory.InventoryClickEvent clickEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is called when the Cancel option is clicked. It should be overridden in subclasses to provide specific functionality.

      当点击Cancel选项时调用此方法。此方法应该在子类中被重写以提供特定的功能。

      Parameters:
      clickEvent - The InventoryClickEvent that triggers this method.

      触发此方法的InventoryClickEvent。