Package com.minecolonies.core.quests
Class QuestTemplate
java.lang.Object
com.minecolonies.core.quests.QuestTemplate
- All Implemented Interfaces:
IQuestTemplate
Instance of a specific quest type
-
Constructor Summary
ConstructorsConstructorDescriptionQuestTemplate(net.minecraft.resources.ResourceLocation questID, net.minecraft.network.chat.Component name, List<net.minecraft.resources.ResourceLocation> parents, int maxOccurrence, Function<IColony, List<ITriggerReturnData<?>>> questTriggerList, List<IQuestObjectiveTemplate> questObjectives, int questTimeout, List<IQuestRewardTemplate> questRewards) Create new quest data. -
Method Summary
Modifier and TypeMethodDescriptionattemptStart(IColony colony) This is where we actually check if the colony fulfills the quest requirements.intHow often we can redo this quest.net.minecraft.network.chat.ComponentgetName()The name of the quest.getObjective(int index) Get the objective at a given index.intGet the objective count of this quest.List<net.minecraft.resources.ResourceLocation> Get the list of parent quests.intTimeout in ingame days until an available quest or in progress quest gets deleted.voidunlockQuestRewards(IColony colony, net.minecraft.world.entity.player.Player player, IQuestInstance colonyQuest, List<Integer> unlockedRewards) Unlock the quest rewards.
-
Constructor Details
-
QuestTemplate
public QuestTemplate(net.minecraft.resources.ResourceLocation questID, net.minecraft.network.chat.Component name, List<net.minecraft.resources.ResourceLocation> parents, int maxOccurrence, Function<IColony, List<ITriggerReturnData<?>>> questTriggerList, List<IQuestObjectiveTemplate> questObjectives, int questTimeout, List<IQuestRewardTemplate> questRewards) Create new quest data.- Parameters:
questID- the id of the quest.name- the name of the quest.parents- the parent quests.maxOccurrence- the max num of occurrences.questTriggerList- the list of triggers.questObjectives- the quest objectives.questTimeout- the time until it times out.questRewards- its rewards
-
-
Method Details
-
attemptStart
Description copied from interface:IQuestTemplateThis is where we actually check if the colony fulfills the quest requirements.- Specified by:
attemptStartin interfaceIQuestTemplate- Parameters:
colony- the colony to check.- Returns:
- the colony quest instance if successful.
-
getQuestTimeout
public int getQuestTimeout()Description copied from interface:IQuestTemplateTimeout in ingame days until an available quest or in progress quest gets deleted.- Specified by:
getQuestTimeoutin interfaceIQuestTemplate- Returns:
- the timeout.
-
getMaxOccurrence
public int getMaxOccurrence()Description copied from interface:IQuestTemplateHow often we can redo this quest.- Specified by:
getMaxOccurrencein interfaceIQuestTemplate- Returns:
- the number.
-
unlockQuestRewards
public void unlockQuestRewards(IColony colony, net.minecraft.world.entity.player.Player player, IQuestInstance colonyQuest, List<Integer> unlockedRewards) Description copied from interface:IQuestTemplateUnlock the quest rewards.- Specified by:
unlockQuestRewardsin interfaceIQuestTemplate- Parameters:
colony- the colony.player- the player.colonyQuest- the quest.unlockedRewards- the applicable rewards.
-
getObjective
Description copied from interface:IQuestTemplateGet the objective at a given index.- Specified by:
getObjectivein interfaceIQuestTemplate- Parameters:
index- the index of the objective.- Returns:
- the current objective.
-
getObjectiveCount
public int getObjectiveCount()Description copied from interface:IQuestTemplateGet the objective count of this quest.- Specified by:
getObjectiveCountin interfaceIQuestTemplate- Returns:
- the count.
-
getName
public net.minecraft.network.chat.Component getName()Description copied from interface:IQuestTemplateThe name of the quest.- Specified by:
getNamein interfaceIQuestTemplate- Returns:
- the name of the quest.
-
getParents
Description copied from interface:IQuestTemplateGet the list of parent quests.- Specified by:
getParentsin interfaceIQuestTemplate- Returns:
- the list of parent quests.
-