Class AbstractQuest
java.lang.Object
com.ordwen.odailyquests.quests.player.progression.PlayerProgressor
com.ordwen.odailyquests.quests.types.AbstractQuest
- All Implemented Interfaces:
IQuest
- Direct Known Subclasses:
BasicQuest
,CarveQuest
,CrateOpenQuest
,CustomMobQuest
,CustomQuest
,EntityQuest
,ExpLevelQuest
,ExpPointsQuest
,FireballReflectQuest
,ItemQuest
,LocationQuest
,MilkingQuest
,NuVotifierQuest
,PlaceholderQuest
,PlayerDeathQuest
,VotifierPlusQuest
Represents an abstract quest that a player can undertake.
This class defines the core properties and methods of a quest, including the quest's name, description, type, reward, required items, and other related attributes. It serves as a base class for specific types of quests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractQuest
(int questIndex, String questName, String categoryName, List<String> questDesc, String questType, org.bukkit.inventory.ItemStack menuItem, org.bukkit.inventory.ItemStack achievedItem, String requiredAmountRaw, Reward reward, List<String> requiredWorlds, List<String> requiredRegions, boolean protectionBypass, String requiredPermission) Constructs a new AbstractQuest with the specified parameters.protected
AbstractQuest
(BasicQuest basicQuest) Constructs a new AbstractQuest from a BasicQuest. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
Get achieved item.Get the name of the category.org.bukkit.inventory.ItemStack
Get menu item.Get the description of the quest.int
Get index of quest.Get the name of the quest.Get the type of quest.Get the amount required by the quest.Get the required permission of the quest.Get the required regions of the quest.Get the required worlds of the quest.Get the reward of the quest.getSelectedDisplayName
(int index) Gets the selected display name for a random required item.protected boolean
isDisplayNameMissing
(org.bukkit.configuration.ConfigurationSection section, String file, String index, String path, String type) Checks if the display name is missing for a random required item.boolean
Get whether the quest has protection bypass.boolean
Check if the quest is random required.boolean
Check if the quest requires a random amount of items.Methods inherited from class com.ordwen.odailyquests.quests.player.progression.PlayerProgressor
actionQuest, fits, isAllowedToProgress, movingItem, setPlayerQuestProgression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ordwen.odailyquests.api.quests.IQuest
canProgress, getType, loadParameters
-
Field Details
-
isRandomRequired
protected boolean isRandomRequired -
displayNames
-
-
Constructor Details
-
AbstractQuest
protected AbstractQuest(int questIndex, String questName, String categoryName, List<String> questDesc, String questType, org.bukkit.inventory.ItemStack menuItem, org.bukkit.inventory.ItemStack achievedItem, String requiredAmountRaw, Reward reward, List<String> requiredWorlds, List<String> requiredRegions, boolean protectionBypass, String requiredPermission) Constructs a new AbstractQuest with the specified parameters.- Parameters:
questIndex
- the index of the quest.questName
- the name of the quest.categoryName
- the category of the quest.questDesc
- the description of the quest.questType
- the type of the quest.menuItem
- the item used in the quest's menu.achievedItem
- the item awarded for completing the quest.requiredAmountRaw
- the required amount of items needed for the quest.reward
- the reward for completing the quest.requiredWorlds
- the worlds required for the quest.requiredRegions
- the regions required for the quest.protectionBypass
- whether protection bypass is enabled for the quest.requiredPermission
- the permission required to undertake the quest.
-
-
Method Details
-
getSelectedDisplayName
Gets the selected display name for a random required item.This method returns a valid display name from the list of display names based on the provided index. If the index is out of bounds or random required is disabled, it returns an error message.
- Parameters:
index
- the index of the display name.- Returns:
- the selected display name or an error message.
-
isDisplayNameMissing
protected boolean isDisplayNameMissing(org.bukkit.configuration.ConfigurationSection section, String file, String index, String path, String type) Checks if the display name is missing for a random required item.This method validates if the display name for a random required item is missing in the configuration. If missing, it logs an error.
- Parameters:
section
- the configuration section to check.file
- the file path where the error occurred.index
- the index of the item.path
- the path to check for missing values.type
- the type of display name.- Returns:
- true if the display name is missing, false otherwise.
-
getQuestIndex
public int getQuestIndex()Get index of quest.- Returns:
- quest index.
-
getQuestType
Get the type of quest.- Returns:
- the type of the quest.
-
getQuestName
Get the name of the quest.- Returns:
- quest name.
-
getCategoryName
Get the name of the category.- Returns:
- category name.
-
getMenuItem
public org.bukkit.inventory.ItemStack getMenuItem()Get menu item.- Returns:
- menu item.
-
getAchievedItem
public org.bukkit.inventory.ItemStack getAchievedItem()Get achieved item.- Returns:
- achieved item.
-
getQuestDesc
Get the description of the quest.- Returns:
- quest description.
-
getRequiredAmountRaw
Get the amount required by the quest.- Returns:
- quest amount-required.
-
getReward
Get the reward of the quest.- Returns:
- quest reward.
-
getRequiredWorlds
Get the required worlds of the quest.- Returns:
- quest required worlds.
-
getRequiredRegions
Get the required regions of the quest.- Returns:
- quest required regions.
-
isProtectionBypass
public boolean isProtectionBypass()Get whether the quest has protection bypass.- Returns:
- quest protection bypass.
-
getRequiredPermission
Get the required permission of the quest.- Returns:
- quest required permission.
-
isRandomRequired
public boolean isRandomRequired()Check if the quest is random required.- Returns:
- true if random required, false otherwise.
-
isRandomRequiredAmount
public boolean isRandomRequiredAmount()Check if the quest requires a random amount of items.- Returns:
- true if the required amount is a range (e.g., "1-5"), false if it is a fixed number (e.g., "3").
-