Class ResearchObjectiveTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
com.minecolonies.core.quests.objectives.ResearchObjectiveTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestObjectiveTemplate,IResearchObjectiveTemplate
public class ResearchObjectiveTemplate
extends DialogueObjectiveTemplateTemplate
implements IResearchObjectiveTemplate
Objective type tracking research.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionResearchObjectiveTemplate(int target, net.minecraft.resources.ResourceLocation researchId, int nextObjective, List<Integer> rewards) Create a new objective of this type. -
Method Summary
Modifier and TypeMethodDescriptionstatic IQuestObjectiveTemplatecreateObjective(com.google.gson.JsonObject jsonObject) Parse the build research objective from json.net.minecraft.network.chat.ComponentgetProgressText(IQuestInstance quest, net.minecraft.network.chat.Style style) Get aComponentinstance with the text containing the progress of this objective.voidonCancellation(IQuestInstance colonyQuest) On objective abort.voidonResearchCompletion(IQuestInstance colonyQuest) Callback for research completion event.voidonWorldLoad(IQuestInstance colonyQuest) On world load trigger.startObjective(IQuestInstance colonyQuest) Initialization of an objective.Methods inherited from class com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
getDialogueTree, getRewardUnlocks, getTarget, parseRewardsMethods 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
-
Constructor Details
-
Method Details
-
createObjective
Parse the build research objective from json.- Parameters:
jsonObject- the json to parse it from.- Returns:
- a new objective object.
-
startObjective
Description copied from interface:IQuestObjectiveTemplateInitialization of an objective.- Specified by:
startObjectivein interfaceIQuestObjectiveTemplate- Overrides:
startObjectivein classDialogueObjectiveTemplateTemplate- 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- Overrides:
getProgressTextin classDialogueObjectiveTemplateTemplate- Parameters:
quest- the quest to get the info from.style- the style to use on subcomponents.- Returns:
- the chat component.
-
onCancellation
Description copied from interface:IQuestObjectiveTemplateOn objective abort.- Specified by:
onCancellationin interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- related colony quest.
-
onWorldLoad
Description copied from interface:IQuestObjectiveTemplateOn world load trigger.- Specified by:
onWorldLoadin interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- the quest.
-
onResearchCompletion
Description copied from interface:IResearchObjectiveTemplateCallback for research completion event.- Specified by:
onResearchCompletionin interfaceIResearchObjectiveTemplate- Parameters:
colonyQuest- the quest instance.
-