Class DeliveryObjectiveTemplateTemplate
java.lang.Object
com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
com.minecolonies.core.quests.objectives.DeliveryObjectiveTemplateTemplate
- All Implemented Interfaces:
IDialogueObjectiveTemplate,IQuestDeliveryObjective,IQuestObjectiveTemplate
public class DeliveryObjectiveTemplateTemplate
extends DialogueObjectiveTemplateTemplate
implements IQuestDeliveryObjective
Delivery type objective.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.quests.IDialogueObjectiveTemplate
IDialogueObjectiveTemplate.AnswerElement, IDialogueObjectiveTemplate.DialogueElement -
Constructor Summary
ConstructorsConstructorDescriptionDeliveryObjectiveTemplateTemplate(int target, net.minecraft.world.item.ItemStack item, int quantity, int nextObjective, List<Integer> rewards, String nbtMode) Create a new delivery objective, -
Method Summary
Modifier and TypeMethodDescriptionstatic IQuestObjectiveTemplatecreateObjective(net.minecraft.core.HolderLookup.Provider provider, com.google.gson.JsonObject jsonObject) Parse the dialogue objective from json.Getter for the dialogue tree.net.minecraft.network.chat.ComponentgetProgressText(IQuestInstance quest, net.minecraft.network.chat.Style style) Get aComponentinstance with the text containing the progress of this objective.Dialogue tree when the conditions are fulfilled.booleanhasItem(net.minecraft.world.entity.player.Player player, IQuestInstance colonyQuest) Check if the objective is ready to move on.booleantryDiscountItem(net.minecraft.world.entity.player.Player player, IQuestInstance colonyQuest) Attempt to resolve an objective.Methods inherited from class com.minecolonies.core.quests.objectives.DialogueObjectiveTemplateTemplate
getRewardUnlocks, getTarget, parseRewards, startObjectiveMethods 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, getRewardUnlocks, getTarget, onCancellation, onWorldLoad, startObjective
-
Constructor Details
-
DeliveryObjectiveTemplateTemplate
public DeliveryObjectiveTemplateTemplate(int target, net.minecraft.world.item.ItemStack item, int quantity, int nextObjective, List<Integer> rewards, String nbtMode) Create a new delivery objective,- Parameters:
target- the target to receive the delivery.item- the item to be delivered.quantity- the quantity to be delivered.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 dialogue objective from json.- Parameters:
jsonObject- the json to parse it from.- Returns:
- a new objective object.
-
hasItem
Description copied from interface:IQuestDeliveryObjectiveCheck if the objective is ready to move on.- Specified by:
hasItemin interfaceIQuestDeliveryObjective- Parameters:
colonyQuest- the objective belongs to.- Returns:
- true if so.
-
tryDiscountItem
public boolean tryDiscountItem(net.minecraft.world.entity.player.Player player, IQuestInstance colonyQuest) Description copied from interface:IQuestDeliveryObjectiveAttempt to resolve an objective.- Specified by:
tryDiscountItemin interfaceIQuestDeliveryObjective- Parameters:
colonyQuest- the objective belongs to.- Returns:
- true if so.
-
getDialogueTree
Description copied from class:DialogueObjectiveTemplateTemplateGetter for the dialogue tree.- Specified by:
getDialogueTreein interfaceIDialogueObjectiveTemplate- Overrides:
getDialogueTreein classDialogueObjectiveTemplateTemplate- Returns:
- the tree.
-
getReadyDialogueTree
Description copied from interface:IQuestDeliveryObjectiveDialogue tree when the conditions are fulfilled.- Specified by:
getReadyDialogueTreein interfaceIQuestDeliveryObjective- Returns:
- the dialogue to play.
-
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.
-