Class QuestAmountSetting

java.lang.Object
com.ordwen.odailyquests.configuration.essentials.QuestAmountSetting

public final class QuestAmountSetting extends Object
Represents the amount of quests assigned for a category.

The amount can either be a fixed integer defined in the configuration or a PlaceholderAPI expression evaluated per player.

  • Method Details

    • from

      public static QuestAmountSetting from(String categoryName, Object rawValue)
      Creates a QuestAmountSetting from the raw configuration value.
      Parameters:
      categoryName - the related category
      rawValue - the raw configuration value
      Returns:
      a parsed QuestAmountSetting
    • resolve

      public int resolve(org.bukkit.entity.Player player)
      Resolves the configured value for a player.

      If the value is static, it is returned immediately. Otherwise, the placeholder expression is evaluated for the provided player.

      Parameters:
      player - the player context
      Returns:
      the resolved amount (never negative)
    • isDynamic

      public boolean isDynamic()
      Indicates whether the amount relies on PlaceholderAPI.
      Returns:
      true if the value is dynamic
    • getStaticAmount

      public Integer getStaticAmount()
      Returns the static amount, if defined.
      Returns:
      the configured static amount or null