Interface ButtonLoader


public interface ButtonLoader
The ButtonLoader interface defines methods for loading buttons and related configurations. Examples of implementations can be found in: You must specify a unique name for your button, typically in the format 'your plugin name'_'button name'. For example, if your plugin is called "test" and your button is called "magic", the name should be 'test_magic'. You can then return a new instance of your button with the essential elements initialized.
  • Method Summary

    Modifier and Type
    Method
    Description
    Class<? extends Button>
    Gets the class that will be used for the button.
    Gets the name of the button.
    org.bukkit.plugin.Plugin
    Gets the plugin from which the button loader originates.
    load(org.bukkit.configuration.file.YamlConfiguration configuration, String path, DefaultButtonValue defaultButtonValue)
    Loads a button based on the provided configuration.
    static List<Integer>
    loadSlot(List<String> slotsAsString)
    Loads a list of strings and transforms it into integers, supporting various slot formats.
  • Method Details

    • loadSlot

      static List<Integer> loadSlot(List<String> slotsAsString)
      Loads a list of strings and transforms it into integers, supporting various slot formats. More information here.
      Parameters:
      slotsAsString - List of slot strings
      Returns:
      List of slots as integers
    • getButton

      Class<? extends Button> getButton()
      Gets the class that will be used for the button.
      Returns:
      The button class.
    • getName

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

      org.bukkit.plugin.Plugin getPlugin()
      Gets the plugin from which the button loader originates.
      Returns:
      The plugin.
    • load

      Button load(org.bukkit.configuration.file.YamlConfiguration configuration, String path, DefaultButtonValue defaultButtonValue)
      Loads a button based on the provided configuration.
      Parameters:
      configuration - The current file configuration.
      path - The current button path.
      defaultButtonValue - Default button values.
      Returns:
      The loaded button.