Class DialogueObjectiveTemplateTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestObjectiveTemplate
- Direct Known Subclasses:
BreakBlockObjectiveTemplate,BuildBuildingObjectiveTemplate,DeliveryObjectiveTemplateTemplate,KillEntityObjectiveTemplateTemplate,PlaceBlockObjectiveTemplate,ResearchObjectiveTemplate
Dialogue type of objective.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionDialogueObjectiveTemplateTemplate(int target, IDialogueObjectiveTemplate.DialogueElement dialogueTree, List<Integer> rewards) Create a new dialogue objective. -
Method Summary
Modifier and TypeMethodDescriptionstatic IQuestObjectiveTemplatecreateObjective(net.minecraft.core.HolderLookup.Provider provider, com.google.gson.JsonObject jsonObject) Parse the dialogue objective from json.Getter for the dialogue tree.net.minecraft.network.chat.ComponentgetProgressText(IQuestInstance quest, net.minecraft.network.chat.Style style) Get aComponentinstance with the text containing the progress of this objective.Get the list of reward unlocks from this objective.intGet the quest target.parseRewards(com.google.gson.JsonObject jsonObject) Parse the specific reward array from the objective.startObjective(IQuestInstance colonyQuest) Initialization of an objective.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.quests.IQuestObjectiveTemplate
createObjectiveInstance, onCancellation, onWorldLoad
-
Constructor Details
-
DialogueObjectiveTemplateTemplate
public DialogueObjectiveTemplateTemplate(int target, IDialogueObjectiveTemplate.DialogueElement dialogueTree, List<Integer> rewards) Create a new dialogue objective.- Parameters:
target- the target of the dialogue.dialogueTree- the dialogue tree.
-
-
Method Details
-
getDialogueTree
Getter for the dialogue tree.- Specified by:
getDialogueTreein interfaceIDialogueObjectiveTemplate- Returns:
- the tree.
-
getRewardUnlocks
Description copied from interface:IQuestObjectiveTemplateGet the list of reward unlocks from this objective.- Specified by:
getRewardUnlocksin interfaceIQuestObjectiveTemplate- Returns:
- the unlocked rewards by this objective.
-
getTarget
public int getTarget()Description copied from interface:IQuestObjectiveTemplateGet the quest target.- Specified by:
getTargetin interfaceIQuestObjectiveTemplate- Returns:
- the target id.
-
createObjective
public static IQuestObjectiveTemplate createObjective(@NotNull net.minecraft.core.HolderLookup.Provider provider, com.google.gson.JsonObject jsonObject) Parse the dialogue objective from json.- Parameters:
jsonObject- the json to parse it from.- Returns:
- a new objective object.
-
parseRewards
Parse the specific reward array from the objective.- Parameters:
jsonObject- the object to get it from.- Returns:
- the unlocked rewards.
-
startObjective
Description copied from interface:IQuestObjectiveTemplateInitialization of an objective.- Specified by:
startObjectivein interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- the colony quest it belongs to.- Returns:
- potentially related objective data.
-
getProgressText
public net.minecraft.network.chat.Component getProgressText(IQuestInstance quest, net.minecraft.network.chat.Style style) Description copied from interface:IQuestObjectiveTemplateGet aComponentinstance with the text containing the progress of this objective.- Specified by:
getProgressTextin interfaceIQuestObjectiveTemplate- Parameters:
quest- the quest to get the info from.style- the style to use on subcomponents.- Returns:
- the chat component.
-