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
Fields inherited from class com.ordwen.odailyquests.quests.player.progression.PlayerProgressor
VERTICAL_PLANTS_DOWN, VERTICAL_PLANTS_UP
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractQuest
(int questIndex, String fileIndex, String questName, String categoryName, List<String> questDesc, String questType, org.bukkit.inventory.ItemStack menuItem, int menuItemAmount, org.bukkit.inventory.ItemStack achievedItem, String requiredAmountRaw, Reward reward, List<String> requiredWorlds, List<String> requiredRegions, boolean protectionBypass, List<String> requiredPermissions, List<PlaceholderCondition> placeholderConditions) 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.Get file index of quest.org.bukkit.inventory.ItemStack
Get menu item.int
Get menu item amount.Get the list of placeholder conditions associated with this quest.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.boolean
Check if the quest has any placeholder conditions.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, handleDrops, isAllowedToProgress, isPlayerPlacedBlock, isVerticalPlant, movingItem, setPlayerQuestProgression, storeBrokenBlockMetadata
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 fileIndex, String questName, String categoryName, List<String> questDesc, String questType, org.bukkit.inventory.ItemStack menuItem, int menuItemAmount, org.bukkit.inventory.ItemStack achievedItem, String requiredAmountRaw, Reward reward, List<String> requiredWorlds, List<String> requiredRegions, boolean protectionBypass, List<String> requiredPermissions, List<PlaceholderCondition> placeholderConditions) Constructs a new AbstractQuest with the specified parameters.- Parameters:
questIndex
- the index of the quest.fileIndex
- the file 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.menuItemAmount
- the amount of the menu item (default is 1).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.requiredPermissions
- the permissions 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.
-
getFileIndex
Get file index of quest.- Returns:
- file 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.
-
getMenuItemAmount
public int getMenuItemAmount()Get menu item amount.- Returns:
- menu item amount.
-
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.
-
getRequiredPermissions
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").
-
getPlaceholderConditions
Get the list of placeholder conditions associated with this quest.- Returns:
- the list of placeholder conditions.
-
hasPlaceholderConditions
public boolean hasPlaceholderConditions()Check if the quest has any placeholder conditions.- Returns:
- true if there are placeholder conditions, false otherwise.
-