Class PlaceBlockObjectiveTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
com.minecolonies.core.quests.objectives.PlaceBlockObjectiveTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestObjectiveTemplate,IPlaceBlockObjectiveTemplate
public class PlaceBlockObjectiveTemplate
extends DialogueObjectiveTemplateTemplate
implements IPlaceBlockObjectiveTemplate
Objective type tracking block placing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionPlaceBlockObjectiveTemplate(int target, int qty, net.minecraft.world.level.block.Block blockToPlace, 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 mine block objective from json.@Nullable 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.voidonBlockPlace(IObjectiveInstance blockPlacementProgressData, IQuestInstance colonyQuest, net.minecraft.world.entity.player.Player player) Callback for block place 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
-
PlaceBlockObjectiveTemplate
public PlaceBlockObjectiveTemplate(int target, int qty, net.minecraft.world.level.block.Block blockToPlace, int nextObjective, List<Integer> rewards) Create a new objective of this type.- Parameters:
target- the target citizen.qty- the number of blocks to place.blockToPlace- the block to place.rewards- the rewards this unlocks.
-
-
Method Details
-
createObjective
Parse the mine block 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.
-
createObjectiveInstance
Description copied from interface:IQuestObjectiveTemplateGet objective data related to the objective.- Specified by:
createObjectiveInstancein interfaceIQuestObjectiveTemplate- Returns:
- the data, default null.
-
onCancellation
Description copied from interface:IQuestObjectiveTemplateOn objective abort.- Specified by:
onCancellationin interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- related colony quest.
-
onBlockPlace
public void onBlockPlace(IObjectiveInstance blockPlacementProgressData, IQuestInstance colonyQuest, net.minecraft.world.entity.player.Player player) Description copied from interface:IPlaceBlockObjectiveTemplateCallback for block place event- Specified by:
onBlockPlacein interfaceIPlaceBlockObjectiveTemplate- Parameters:
blockPlacementProgressData- the objective data.player- the involved player.
-
onWorldLoad
Description copied from interface:IQuestObjectiveTemplateOn world load trigger.- Specified by:
onWorldLoadin interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- the quest.
-