Class BreakBlockObjectiveTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
com.minecolonies.core.quests.objectives.BreakBlockObjectiveTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestObjectiveTemplate,IBreakBlockObjectiveTemplate
public class BreakBlockObjectiveTemplate
extends DialogueObjectiveTemplateTemplate
implements IBreakBlockObjectiveTemplate
Objective type tracking block mining.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionBreakBlockObjectiveTemplate(int target, int blocksToMine, net.minecraft.world.level.block.Block blockToMine, 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 mine block 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.voidonBlockBreak(IObjectiveInstance blockMiningProgressData, IQuestInstance colonyQuest, net.minecraft.world.entity.player.Player player) Callback for block break 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
-
BreakBlockObjectiveTemplate
public BreakBlockObjectiveTemplate(int target, int blocksToMine, net.minecraft.world.level.block.Block blockToMine, int nextObjective, List<Integer> rewards) Create a new objective of this type.- Parameters:
target- the target citizen.blocksToMine- the number of blocks to mine.blockToMine- the block to mine.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 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.
-
onBlockBreak
public void onBlockBreak(IObjectiveInstance blockMiningProgressData, IQuestInstance colonyQuest, net.minecraft.world.entity.player.Player player) Description copied from interface:IBreakBlockObjectiveTemplateCallback for block break event- Specified by:
onBlockBreakin interfaceIBreakBlockObjectiveTemplate- Parameters:
blockMiningProgressData- the objective data.player- the involved player.
-
onWorldLoad
Description copied from interface:IQuestObjectiveTemplateOn world load trigger.- Specified by:
onWorldLoadin interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- the quest.
-