All Implemented Interfaces:
IInterfaceItem, IItemGetter, IExternalItemGetter

public class PlayerQuestsInterface extends InterfaceItemGetter
Handles the loading, preparation and dynamic rendering of the player quests interface.

This class is responsible for:

  • Parsing the player interface configuration file
  • Loading static items (fillers, buttons, command triggers...)
  • Assigning quests to inventory slots
  • Replacing placeholders dynamically for each player
  • Applying custom model data and item model identifiers
  • Building the final inventory instance for a specific player
  • Executing associated commands when specific items are clicked
The interface supports:
  • Custom textures (heads)
  • Vanilla materials
  • Namespaced items (ItemsAdder/Oraxen/etc.)
  • PAPI placeholders in name and lore
  • Quest progression placeholders: %progress%, %required%, %progressBar%...
Important: Static items are stored in playerQuestsInventoryBase, while dynamic quest items and PAPI-dependent items are merged into a fresh cloned inventory for each player.
  • Constructor Details

    • PlayerQuestsInterface

      public PlayerQuestsInterface(PlayerInterfaceFile playerInterfaceFile)
      Creates a new player quests interface loader.
      Parameters:
      playerInterfaceFile - the configuration file defining layout, items and settings
  • Method Details

    • load

      public void load()
      Loads and parses the entire player interface definition.

      This method:

      • Reads global variables
      • Loads the mapping between quests and interface slots
      • Loads static items (fillers, buttons, command items...)
      • Handles item models, flags, names and lore
      If misconfigured sections are found, appropriate errors are logged and the interface will be partially or fully disabled.
    • getPlayerQuestsInterface

      public org.bukkit.inventory.Inventory getPlayerQuestsInterface(org.bukkit.entity.Player player)
      Builds and returns the complete, fully-rendered quests inventory for a specific player.

      The returned inventory:

      • Starts from the static base inventory
      • Applies dynamic placeholders on PAPI-enabled items
      • Injects the player's head (if configured)
      • Places quest items depending on progression
      If the player has no loaded quests (e.g., reload during session), errors are logged.
      Parameters:
      player - the player for whom the inventory is generated
      Returns:
      the final rendered inventory, or null if generation failed
    • getInterfaceName

      public String getInterfaceName(org.bukkit.entity.Player player)
      Get the corresponding text for the interface name.
      Parameters:
      player - player to get the interface name.
      Returns:
      the interface name.
    • isFillItem

      public boolean isFillItem(org.bukkit.inventory.ItemStack itemStack)
      Check if the item is used to fill the inventory.
      Parameters:
      itemStack - item to check.
      Returns:
      true if the item is used to fill the inventory, false otherwise.
    • isCloseItem

      public boolean isCloseItem(org.bukkit.inventory.ItemStack itemStack)
      Check if the item is used to close the inventory.
      Parameters:
      itemStack - item to check.
      Returns:
      true if the item is used to close the inventory, false otherwise.
    • isPlayerCommandItem

      public boolean isPlayerCommandItem(int slot)
      Check if the item is used to execute a command as a player.
      Parameters:
      slot - slot of the item.
      Returns:
      true if the item is used to execute a player command, false otherwise.
    • isConsoleCommandItem

      public boolean isConsoleCommandItem(int slot)
      Check if the item is used to execute a command as a console.
      Parameters:
      slot - slot of the item.
      Returns:
      true if the item is used to execute a console command, false otherwise.
    • getPlayerCommands

      public List<String> getPlayerCommands(int slot)
      Get all player commands that can be executed by the item in the given slot.
      Parameters:
      slot - slot of the item.
      Returns:
      the player commands of the item.
    • getConsoleCommands

      public List<String> getConsoleCommands(int slot)
      Get all console commands that can be executed by the item in the given slot.
      Parameters:
      slot - slot of the item.
      Returns:
      the console commands of the item.
    • getAchievedStr

      public String getAchievedStr()
      Get the achieved string defined in the configuration.
      Returns:
      the achieved string.
    • getProgressStr

      public String getProgressStr()
      Get the status string defined in the configuration.
      Returns:
      the status string.
    • getCompleteGetTypeStr

      public String getCompleteGetTypeStr()
      Get the complete get type string defined in the configuration.
      Returns:
      the complete get type string.