Class StatefulDeclarativeGui<T extends StatefulDeclarativeGui<T>.State>

java.lang.Object
mc.obliviate.inventory.Gui
com.ultikits.ultitools.abstracts.gui.declarative.engine.DeclarativeGui
com.ultikits.ultitools.abstracts.gui.declarative.engine.StatefulDeclarativeGui<T>
Type Parameters:
T - State 类型
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public abstract class StatefulDeclarativeGui<T extends StatefulDeclarativeGui<T>.State> extends DeclarativeGui
StatefulDeclarativeGui 支持状态的声明式 GUI 基类。

它内部管理一个 State 对象,提供 setState(Runnable) 方法来触发重建。

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    声明式 GUI 的状态基类。
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private T
     

    Fields inherited from class com.ultikits.ultitools.abstracts.gui.declarative.engine.DeclarativeGui

    id

    Fields inherited from class mc.obliviate.inventory.Gui

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    StatefulDeclarativeGui(@NotNull org.bukkit.entity.Player player, @NotNull String id, @NotNull String title, int rows)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract T
    创建状态对象。
    protected T
    获取状态对象。
    protected void
    setState(@NotNull Runnable action)
    设置状态并触发重建。

    Methods inherited from class com.ultikits.ultitools.abstracts.gui.declarative.engine.DeclarativeGui

    build, getPlayer, getRenderer, isInitialized, markNeedsBuild, onClick, onClose, onGuiClick, onGuiClose, onGuiOpen, onOpen

    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, 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
  • Field Details

  • Constructor Details

    • StatefulDeclarativeGui

      public StatefulDeclarativeGui(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, @NotNull @NotNull String title, int rows)
  • Method Details

    • createState

      @NotNull protected abstract T createState()
      创建状态对象。
      Returns:
      状态对象
    • getState

      @NotNull protected T getState()
      获取状态对象。
      Returns:
      状态对象
    • setState

      protected void setState(@NotNull @NotNull Runnable action)
      设置状态并触发重建。
      Overrides:
      setState in class DeclarativeGui
      Parameters:
      action - 状态修改操作