Class Quest

java.lang.Object
com.storytimeproductions.models.Quest

public class Quest extends Object
Represents a quest that a player can complete in the game. A quest contains a name, description (lore), item requirements, rewards, an optional deadline, and optional player-specific participation conditions.
  • Constructor Details

    • Quest

      public Quest(String id, String name, String lore, List<String> requirements, List<String> statRequirements, List<String> rewards, List<UUID> requiredPlayers, LocalDateTime deadline, org.bukkit.Material icon)
      Constructs a new Quest object with the specified parameters.
      Parameters:
      id - the unique identifier of the quest
      name - the display name of the quest
      lore - the lore or description of the quest
      requirements - a list of item requirements formatted as "ITEM:AMOUNT"
      rewards - a list of rewards formatted as "TYPE:AMOUNT"
      requiredPlayers - a list of player UUIDs required to complete this quest
      deadline - an optional deadline for the quest
      icon - the icon representing the quest in the GUI
  • Method Details

    • getIcon

      public org.bukkit.Material getIcon()
      Gets the icon representing the quest in the GUI.
      Returns:
      the quest icon
    • getId

      public String getId()
      Gets the unique identifier of the quest.
      Returns:
      the quest ID
    • getName

      public String getName()
      Gets the display name of the quest.
      Returns:
      the quest name
    • getLore

      public String getLore()
      Gets the lore or description of the quest.
      Returns:
      the quest lore
    • getItemRequirements

      public List<String> getItemRequirements()
      Gets the list of item requirements.
      Returns:
      a list of requirements formatted as "ITEM:AMOUNT"
    • getStatRequirements

      public List<String> getStatRequirements()
      Gets the list of stat requirements.
      Returns:
      a list of requirements formatted as "STAT:AMOUNT"
    • getRewards

      public List<String> getRewards()
      Gets the list of rewards for completing the quest.
      Returns:
      a list of rewards formatted as "TYPE:AMOUNT"
    • getRequiredPlayers

      public List<UUID> getRequiredPlayers()
      Gets the list of players required to complete this quest.
      Returns:
      a list of player UUIDs or an empty list if the quest is open to all
    • getDeadline

      public String getDeadline()
      Gets the optional deadline for the quest.
      Returns:
      the deadline as a LocalDateTime, or null if the quest is indefinite
    • isDefaultQuest

      public boolean isDefaultQuest()
      Determines if the quest is available to all players (i.e., not limited to specific players).
      Returns:
      true if the quest is open to all players, false if restricted to specific players
    • isAvailableTo

      public boolean isAvailableTo(UUID playerUuid)
      Checks whether a specific player is eligible to undertake the quest.
      Parameters:
      playerUuid - the UUID of the player
      Returns:
      true if the quest is either default or specifically assigned to the player
    • isExpired

      public boolean isExpired()
      Checks whether the quest has expired based on the current date and time.
      Returns:
      true if the current time is after the deadline, false otherwise (or if no deadline)
    • toString

      public String toString()
      Returns a string representation of the quest, including ID, name, lore, requirements, rewards, required players, and deadline.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this quest