Class KillEntityObjectiveTemplateTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
com.minecolonies.core.quests.objectives.KillEntityObjectiveTemplateTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestObjectiveTemplate,IKillEntityObjectiveTemplate
public class KillEntityObjectiveTemplateTemplate
extends DialogueObjectiveTemplateTemplate
implements IKillEntityObjectiveTemplate
Objective type entity killing mining.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionKillEntityObjectiveTemplateTemplate(int target, int entitiesToKill, net.minecraft.world.entity.EntityType<?> entityToKill, 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.@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.voidonCancellation(IQuestInstance colonyQuest) On objective abort.voidonEntityKill(IObjectiveInstance killProgressData, IQuestInstance colonyQuest, net.minecraft.world.entity.player.Player player) Callback for entity kill eventvoidonWorldLoad(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
-
KillEntityObjectiveTemplateTemplate
public KillEntityObjectiveTemplateTemplate(int target, int entitiesToKill, net.minecraft.world.entity.EntityType<?> entityToKill, int nextObjective, List<Integer> rewards) Create a new objective of this type.- Parameters:
target- the target citizen.entitiesToKill- the number of entities to kill.entityToKill- the entity to kill.
-
-
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.
-
onEntityKill
public void onEntityKill(IObjectiveInstance killProgressData, IQuestInstance colonyQuest, net.minecraft.world.entity.player.Player player) Description copied from interface:IKillEntityObjectiveTemplateCallback for entity kill event- Specified by:
onEntityKillin interfaceIKillEntityObjectiveTemplate- Parameters:
killProgressData- the objective data.player- the involved player.
-
onWorldLoad
Description copied from interface:IQuestObjectiveTemplateOn world load trigger.- Specified by:
onWorldLoadin interfaceIQuestObjectiveTemplate- Parameters:
colonyQuest- the quest.
-