Class BaseAsyncGUIPane<T,S extends BaseAsyncGUIPane<T,S>>

Type Parameters:
T - Result of the async task
S - The implementing class to return this-type correctly e.g. BaseSimpleGUIPane.addItemEmptySlot(GUIItem)
All Implemented Interfaces:
Sizeable
Direct Known Subclasses:
AsyncGUIPane

public abstract class BaseAsyncGUIPane<T,S extends BaseAsyncGUIPane<T,S>> extends BaseSimpleGUIPane<GUISection,S>
Base class for AsyncGUIPane
  • Constructor Details

    • BaseAsyncGUIPane

      protected BaseAsyncGUIPane(GUI gui, Vector2d minSize, Vector2d maxSize, boolean autoSize, CompletableFuture<T> task, @Nullable @Nullable Consumer<T> onComplete, GUIItem loadingGUIItem)
      Creates a new BaseSimpleGUIPane
      Parameters:
      gui - The GUI
      minSize - The minimum size of the Pane
      maxSize - The maximum size of the Pane
      autoSize - Whether to automatically resize the pane according to the children. If true it will set the size to the bounding box of all children.
      task - The running task
      onComplete - The callback that is executed when the task finishes
      loadingGUIItem - The item that is shown while the task is running
  • Method Details

    • onTaskComplete

      protected void onTaskComplete(T data)
      Called when the task completes. Can be overridden to use it instead of the callback
      Parameters:
      data - The result of the task