Class QuestsLoader

All Implemented Interfaces:
IItemGetter, IQuestItem, IExternalItemGetter

public class QuestsLoader extends QuestItemGetter
Responsible for loading quests from configuration files.

This loader handles:

  • Reading quest definitions from YAML files
  • Validating configuration values
  • Creating BasicQuest objects
  • Instantiating final quest implementations based on their type
  • Loading quest rewards
  • Reading placeholder-based conditions

Invalid configurations are reported through PluginLogger, and the corresponding quests are skipped gracefully.

  • Constructor Details

    • QuestsLoader

      public QuestsLoader()
  • Method Details

    • loadQuests

      public void loadQuests(org.bukkit.configuration.file.FileConfiguration file, List<AbstractQuest> quests, String fileName)
      Loads all quests defined in a configuration file.

      For each quest entry:

      • Reads base quest attributes
      • Validates configuration
      • Instantiates the concrete quest type
      • Adds the quest to the provided list

      Invalid quests are skipped, and their errors logged.

      Parameters:
      file - the YAML file containing quests
      quests - the list to populate with loaded quests
      fileName - the file name used for logging