Class BuildBuildingObjectiveTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
com.minecolonies.core.quests.objectives.BuildBuildingObjectiveTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestObjectiveTemplate,IBuildingUpgradeObjectiveTemplate
public class BuildBuildingObjectiveTemplate
extends DialogueObjectiveTemplateTemplate
implements IBuildingUpgradeObjectiveTemplate
Objective type tracking build building.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionBuildBuildingObjectiveTemplate(int target, BuildingEntry buildingEntry, int lvl, int qty, boolean countExisting, int nextObjective, List<Integer> rewards) Create a new objective of this type. -
Method Summary
Modifier and TypeMethodDescriptionstatic IQuestObjectiveTemplatecreateObjective(net.minecraft.core.HolderLookup.Provider provider, com.google.gson.JsonObject jsonObject) Parse the build building objective from json.@NotNull IObjectiveInstanceGet objective data related to the objective.net.minecraft.network.chat.ComponentgetProgressText(IQuestInstance quest, net.minecraft.network.chat.Style style) Get aComponentinstance with the text containing the progress of this objective.voidonBuildingUpgrade(IObjectiveInstance progressData, IQuestInstance colonyQuest, int level) Callback for block upgrade eventvoidonCancellation(IQuestInstance colonyQuest) On objective abort.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, parseRewards
-
Constructor Details
-
BuildBuildingObjectiveTemplate
public BuildBuildingObjectiveTemplate(int target, BuildingEntry buildingEntry, int lvl, int qty, boolean countExisting, int nextObjective, List<Integer> rewards) Create a new objective of this type.- Parameters:
target- the target citizen.buildingEntry- the building to level.qty- the number of levels.rewards- the rewards this unlocks.
-
-
Method Details
-
createObjective
public static IQuestObjectiveTemplate createObjective(@NotNull net.minecraft.core.HolderLookup.Provider provider, com.google.gson.JsonObject jsonObject) Parse the build building 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.
-
createObjectiveInstance
Description copied from interface:IQuestObjectiveTemplateGet objective data related to the objective.- Specified by:
createObjectiveInstancein interfaceIQuestObjectiveTemplate- Returns:
- the data, default null.
-
onBuildingUpgrade
public void onBuildingUpgrade(IObjectiveInstance progressData, IQuestInstance colonyQuest, int level) Description copied from interface:IBuildingUpgradeObjectiveTemplateCallback for block upgrade event- Specified by:
onBuildingUpgradein interfaceIBuildingUpgradeObjectiveTemplate- Parameters:
progressData- the objective data.colonyQuest- the quest.level- reached lvl.
-