Class PlaceholderQuestCommand
java.lang.Object
com.ordwen.odailyquests.quests.player.progression.clickable.QuestCommand<PlaceholderQuest>
com.ordwen.odailyquests.quests.player.progression.clickable.commands.PlaceholderQuestCommand
Command implementation for handling quests of type
PLACEHOLDER
.
This command evaluates a placeholder-based condition for the executing player.
It checks whether PlaceholderAPI is available, resolves the placeholder and
expected values, and compares them according to the quest's ConditionOperator
.
If the condition matches, the quest is completed. If the condition cannot be evaluated due to invalid input format, or if it does not match, the player receives appropriate feedback messages defined by the quest configuration.
-
Field Summary
Fields inherited from class com.ordwen.odailyquests.quests.player.progression.clickable.QuestCommand
context, progression, quest
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderQuestCommand
(QuestContext context, Progression progression, PlaceholderQuest quest) Creates a new command for evaluating a placeholder quest. -
Method Summary
Methods inherited from class com.ordwen.odailyquests.quests.player.progression.clickable.QuestCommand
completeQuest, sendMessage
-
Constructor Details
-
PlaceholderQuestCommand
public PlaceholderQuestCommand(QuestContext context, Progression progression, PlaceholderQuest quest) Creates a new command for evaluating a placeholder quest.- Parameters:
context
- the quest context providing execution detailsprogression
- the current progression of the playerquest
- the placeholder quest being executed
-
-
Method Details
-
execute
public void execute()Executes the validation of a placeholder quest.- Ensures the player is allowed to progress in the quest.
- Verifies that PlaceholderAPI is enabled.
- Resolves and compares the placeholder value with the expected value.
- Completes the quest if the condition is satisfied, or displays an error message otherwise.
- Specified by:
execute
in classQuestCommand<PlaceholderQuest>
-