Interface GuiRenderEngine

All Known Implementing Classes:
DefaultGuiRenderEngine

public interface GuiRenderEngine
GuiRenderEngine is an interface for rendering GUIs and managing their views.

Created: 06.04.2023 Author: Tobias Madlberger (Tobias)

  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull org.bukkit.inventory.Inventory
    createInventory(@NotNull GuiContext context, @NotNull org.bukkit.entity.Player viewer, @NotNull Map<String,String> placeholders)
    Creates an inventory representing the GUI using the provided GuiContext and placeholders.
    Retrieves the GuiViewManager associated with this render engine.
    void
    renderGui(@NotNull org.bukkit.inventory.ItemStack[][] renderBuffer, @NotNull GuiContext context, @NotNull org.bukkit.entity.Player viewer)
    Renders the GUI using the provided render buffer, GuiContext, and Player viewer.
    default void
    showGui(@NotNull GuiContext content, @NotNull org.bukkit.entity.Player viewer, @NotNull Map<String,String> placeholders)
    Shows the GUI to the specified player using the provided GuiContext and placeholders.
  • Method Details

    • getGuiViewManager

      @NotNull @NotNull GuiViewManager getGuiViewManager()
      Retrieves the GuiViewManager associated with this render engine.
      Returns:
      The GuiViewManager instance.
    • renderGui

      void renderGui(@NotNull @NotNull org.bukkit.inventory.ItemStack[][] renderBuffer, @NotNull @NotNull GuiContext context, @NotNull @NotNull org.bukkit.entity.Player viewer)
      Renders the GUI using the provided render buffer, GuiContext, and Player viewer.
      Parameters:
      renderBuffer - The 2D array of ItemStacks representing the render buffer.
      context - The GuiContext to be rendered.
      viewer - The Player who will view the rendered GUI.
    • showGui

      default void showGui(@NotNull @NotNull GuiContext content, @NotNull @NotNull org.bukkit.entity.Player viewer, @NotNull @NotNull Map<String,String> placeholders)
      Shows the GUI to the specified player using the provided GuiContext and placeholders.
      Parameters:
      content - The GuiContext representing the GUI content to be displayed.
      viewer - The Player who will view the GUI.
      placeholders - A map of placeholders used for dynamic content in the GUI.
    • createInventory

      @NotNull default @NotNull org.bukkit.inventory.Inventory createInventory(@NotNull @NotNull GuiContext context, @NotNull @NotNull org.bukkit.entity.Player viewer, @NotNull @NotNull Map<String,String> placeholders)
      Creates an inventory representing the GUI using the provided GuiContext and placeholders.
      Parameters:
      context - The GuiContext representing the GUI content.
      viewer - The Player who will view the GUI.
      placeholders - A map of placeholders used for dynamic content in the GUI.
      Returns:
      The created Inventory representing the GUI.