public abstract class QuestRequirementChecker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected InventoryItemRemover |
itemRemover
The item remover to collect quest items.
|
protected java.util.List<java.lang.String> |
itemStackLores
The requirements, how they would appear on an item.
|
protected java.util.List<java.lang.String> |
objectiveLores
The requirements, how they would appear in the sidebar.
|
protected int |
phase
The quest phase to check requirements for.
|
protected org.bukkit.entity.Player |
player
The player that is doing the quest.
|
protected WauzQuest |
quest
The quest to check requirements for.
|
protected java.lang.String |
trackerLocationString
The location of the next objective for the quest tracker.
|
protected java.lang.String |
trackerName
The name of the next objective for the quest tracker.
|
Constructor and Description |
---|
QuestRequirementChecker(org.bukkit.entity.Player player,
WauzQuest quest,
int phase)
Initializes a new quest requirement checker.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
checkRequirements()
Checks if the requirements have been fulfilled.
|
static QuestRequirementChecker |
create(org.bukkit.entity.Player player,
WauzQuest quest,
int phase)
Creates a quest requirement checker, based on the type of the phase.
|
protected abstract boolean |
execute(boolean onlyObjectives)
Checks the requirements of the quest and creates corresponding tracker locations and lore.
|
java.util.List<java.lang.String> |
getItemStackLores() |
java.util.List<java.lang.String> |
getItemStackLoresUnaccepted() |
java.util.List<java.lang.String> |
getObjectiveLores(java.lang.String questMargin,
org.bukkit.ChatColor questColor)
Generates a list of a quest and its objectives, to show in the sidebar.
|
abstract void |
handInItems()
Hands in quest related items, if any were needed.
|
abstract void |
initRequirements()
Initializes configuration values for the requirements, if any are needed.
|
void |
trackQuestObjective()
Tracks the current quest objective, or the questgiver, if the quest hasn't started yet.
|
protected org.bukkit.entity.Player player
protected WauzQuest quest
protected int phase
protected java.util.List<java.lang.String> itemStackLores
protected java.util.List<java.lang.String> objectiveLores
protected java.lang.String trackerLocationString
protected java.lang.String trackerName
protected InventoryItemRemover itemRemover
public QuestRequirementChecker(org.bukkit.entity.Player player, WauzQuest quest, int phase)
player
- The player that is doing the quest.quest
- The quest to check requirements for.phase
- The quest phase to check requirements for.public static QuestRequirementChecker create(org.bukkit.entity.Player player, WauzQuest quest, int phase)
player
- The player that is doing the quest.quest
- The quest to check requirements for.phase
- The quest phase to check requirements for.public java.util.List<java.lang.String> getItemStackLores()
public java.util.List<java.lang.String> getItemStackLoresUnaccepted()
public java.util.List<java.lang.String> getObjectiveLores(java.lang.String questMargin, org.bukkit.ChatColor questColor)
questMargin
- The empty space above the title.questColor
- The color of the quest type.public void trackQuestObjective()
public abstract void initRequirements()
public abstract boolean checkRequirements()
public abstract void handInItems()
protected abstract boolean execute(boolean onlyObjectives)
onlyObjectives
- If only objectives and no progress should appear in the lore.