Interface ButtonOption


public interface ButtonOption
Represents a button option within a plugin's user interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the name of the button option.
    org.bukkit.plugin.Plugin
    Gets the plugin instance associated with this button option.
    void
    loadButton(Button button, org.bukkit.configuration.file.YamlConfiguration configuration, String path, InventoryManager inventoryManager, ButtonManager buttonManager, fr.maxlego08.menu.zcore.utils.loader.Loader<fr.maxlego08.menu.MenuItemStack> itemStackLoader, File file)
    Loads a button configuration from a YAML file.
    void
    onClick(Button button, org.bukkit.entity.Player player, org.bukkit.event.inventory.InventoryClickEvent event, fr.maxlego08.menu.inventory.inventories.InventoryDefault inventory, int slot, boolean isSuccess)
    Handles a click event on a button by a player.
  • Method Details

    • getName

      String getName()
      Gets the name of the button option.
      Returns:
      The name of this button option.
    • getPlugin

      org.bukkit.plugin.Plugin getPlugin()
      Gets the plugin instance associated with this button option.
      Returns:
      The plugin instance.
    • loadButton

      void loadButton(Button button, org.bukkit.configuration.file.YamlConfiguration configuration, String path, InventoryManager inventoryManager, ButtonManager buttonManager, fr.maxlego08.menu.zcore.utils.loader.Loader<fr.maxlego08.menu.MenuItemStack> itemStackLoader, File file)
      Loads a button configuration from a YAML file. This method is responsible for initializing a button with specific settings defined in a YAML configuration file. It utilizes an InventoryManager, a ButtonManager, and a Loader for MenuItemStack to fully configure the button.
      Parameters:
      button - The button to configure.
      configuration - The YAML configuration containing the button settings.
      path - The path within the YAML file where the button's settings are defined.
      inventoryManager - The inventory manager to use for inventory operations.
      buttonManager - The button manager to use for button-related operations.
      itemStackLoader - The loader to use for loading MenuItemStack instances.
      file - The file from which the configuration is loaded.
    • onClick

      void onClick(Button button, org.bukkit.entity.Player player, org.bukkit.event.inventory.InventoryClickEvent event, fr.maxlego08.menu.inventory.inventories.InventoryDefault inventory, int slot, boolean isSuccess)
      Handles a click event on a button by a player. This method is called when a player clicks a button. It allows for custom actions to be executed based on the button clicked, the player who clicked it, and the context in which the click occurred.
      Parameters:
      button - The button that was clicked.
      player - The player who clicked the button.
      event - The click event that occurred.
      inventory - The inventory in which the click occurred.
      slot - The slot number where the click occurred.
      isSuccess - Indicates whether the action associated with the button was successful.