Package com.storytimeproductions.models
Class Quest
java.lang.Object
com.storytimeproductions.models.Quest
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the optional deadline for the quest.org.bukkit.Material
getIcon()
Gets the icon representing the quest in the GUI.getId()
Gets the unique identifier of the quest.Gets the list of item requirements.getLore()
Gets the lore or description of the quest.getName()
Gets the display name of the quest.Gets the list of players required to complete this quest.Gets the list of rewards for completing the quest.Gets the list of stat requirements.boolean
isAvailableTo
(UUID playerUuid) Checks whether a specific player is eligible to undertake the quest.boolean
Determines if the quest is available to all players (i.e., not limited to specific players).boolean
Checks whether the quest has expired based on the current date and time.toString()
Returns a string representation of the quest, including ID, name, lore, requirements, rewards, required players, and deadline.
-
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 questname
- the display name of the questlore
- the lore or description of the questrequirements
- 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 questdeadline
- an optional deadline for the questicon
- 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
Gets the unique identifier of the quest.- Returns:
- the quest ID
-
getName
Gets the display name of the quest.- Returns:
- the quest name
-
getLore
Gets the lore or description of the quest.- Returns:
- the quest lore
-
getItemRequirements
Gets the list of item requirements.- Returns:
- a list of requirements formatted as "ITEM:AMOUNT"
-
getStatRequirements
Gets the list of stat requirements.- Returns:
- a list of requirements formatted as "STAT:AMOUNT"
-
getRewards
Gets the list of rewards for completing the quest.- Returns:
- a list of rewards formatted as "TYPE:AMOUNT"
-
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
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
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
Returns a string representation of the quest, including ID, name, lore, requirements, rewards, required players, and deadline.
-