Class QuestDialogueInteraction
java.lang.Object
com.minecolonies.api.colony.interactionhandling.AbstractInteractionResponseHandler
com.minecolonies.core.colony.interactionhandling.ServerCitizenInteraction
com.minecolonies.core.colony.interactionhandling.StandardInteraction
com.minecolonies.core.colony.interactionhandling.QuestDialogueInteraction
- All Implemented Interfaces:
IInteractionResponseHandler,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
QuestDeliveryInteraction
A simple quest dialogue interaction that deals with different dialogue trees.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ICitizenThe respective citizen.protected IQuestInstanceCurrently open colony quest.The current dialogue element.protected booleanSome finished flag to make it disappear more quickly on the client side.protected intIndex in the quest.protected net.minecraft.resources.ResourceLocationThe quest resource location.The current dialogue element.Fields inherited from class com.minecolonies.core.colony.interactionhandling.StandardInteraction
INTERACTION_R_IGNORE, INTERACTION_R_OKAY, INTERACTION_R_REMIND, INTERACTION_R_SKIPFields inherited from class com.minecolonies.core.colony.interactionhandling.ServerCitizenInteraction
parents, validatorId -
Constructor Summary
ConstructorsConstructorDescriptionQuestDialogueInteraction(net.minecraft.network.chat.Component inquiry, IChatPriority priority, net.minecraft.resources.ResourceLocation location, int index, ICitizenData citizenData) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(@NotNull net.minecraft.nbt.CompoundTag compoundNBT) Deserialize the response handler from NBT.net.minecraft.network.chat.ComponentgetId()Get the id.net.minecraft.network.chat.ComponentThe inquiry of the GUI to the player.net.minecraft.resources.ResourceLocationGets the icon to render for this interactionList<net.minecraft.network.chat.Component>Get a list of all possible responses.getType()Type id used to deserialize.booleanisValid(ICitizenData citizen) Check if this response handler is still valid.booleanisVisible(net.minecraft.world.level.Level world) Check if this response handler is still visible for the player.booleanonClientResponseTriggered(int responseId, net.minecraft.world.entity.player.Player player, ICitizenDataView data, com.ldtteam.blockui.views.BOWindow window) Client side action triggered on a possible response.voidonClosed()Trigger on forcefully closing the interaction.voidonOpened(net.minecraft.world.entity.player.Player player) Trigger on opening the interaction.voidonServerResponseTriggered(int responseId, net.minecraft.world.entity.player.Player player, ICitizenData data) Server side action triggered on a possible response.net.minecraft.nbt.CompoundTagSerialize the response handler to NBT.Methods inherited from class com.minecolonies.core.colony.interactionhandling.StandardInteraction
genChildInteractionsMethods inherited from class com.minecolonies.core.colony.interactionhandling.ServerCitizenInteraction
addParent, loadValidator, removeParentMethods inherited from class com.minecolonies.api.colony.interactionhandling.AbstractInteractionResponseHandler
getPriority, getResponseResult, isPrimaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.interactionhandling.IInteractionResponseHandler
getInquiry, onWindowOpened
-
Field Details
-
colonyQuest
Currently open colony quest. -
citizen
The respective citizen. -
questId
protected net.minecraft.resources.ResourceLocation questIdThe quest resource location. -
index
protected int indexIndex in the quest. -
startElement
The current dialogue element. -
currentElement
The current dialogue element. -
finished
protected boolean finishedSome finished flag to make it disappear more quickly on the client side.
-
-
Constructor Details
-
QuestDialogueInteraction
public QuestDialogueInteraction(net.minecraft.network.chat.Component inquiry, IChatPriority priority, net.minecraft.resources.ResourceLocation location, int index, ICitizenData citizenData) -
QuestDialogueInteraction
-
-
Method Details
-
onServerResponseTriggered
public void onServerResponseTriggered(int responseId, net.minecraft.world.entity.player.Player player, ICitizenData data) Description copied from interface:IInteractionResponseHandlerServer side action triggered on a possible response.- Specified by:
onServerResponseTriggeredin interfaceIInteractionResponseHandler- Overrides:
onServerResponseTriggeredin classServerCitizenInteraction- Parameters:
responseId- the clicked string response of the player.player- the world it was triggered in.data- the citizen related to it.
-
onClientResponseTriggered
public boolean onClientResponseTriggered(int responseId, net.minecraft.world.entity.player.Player player, ICitizenDataView data, com.ldtteam.blockui.views.BOWindow window) Description copied from interface:IInteractionResponseHandlerClient side action triggered on a possible response.- Specified by:
onClientResponseTriggeredin interfaceIInteractionResponseHandler- Overrides:
onClientResponseTriggeredin classServerCitizenInteraction- Parameters:
responseId- the clicked index.player- the client side world.data- the citizen data assigned to it.window- the window it was triggered in.- Returns:
- if wishing to continue interacting.
-
onOpened
public void onOpened(net.minecraft.world.entity.player.Player player) Description copied from interface:IInteractionResponseHandlerTrigger on opening the interaction. -
getId
public net.minecraft.network.chat.Component getId()Description copied from interface:IInteractionResponseHandlerGet the id.- Specified by:
getIdin interfaceIInteractionResponseHandler- Overrides:
getIdin classServerCitizenInteraction- Returns:
- the id.
-
onClosed
public void onClosed()Description copied from interface:IInteractionResponseHandlerTrigger on forcefully closing the interaction. -
getInquiry
public net.minecraft.network.chat.Component getInquiry()Description copied from interface:IInteractionResponseHandlerThe inquiry of the GUI to the player. This is the key for the interaction, functions as id.- Specified by:
getInquiryin interfaceIInteractionResponseHandler- Overrides:
getInquiryin classAbstractInteractionResponseHandler- Returns:
- the text inquiry.
-
isVisible
public boolean isVisible(net.minecraft.world.level.Level world) Description copied from interface:IInteractionResponseHandlerCheck if this response handler is still visible for the player.- Specified by:
isVisiblein interfaceIInteractionResponseHandler- Overrides:
isVisiblein classServerCitizenInteraction- Parameters:
world- the world this citizen is in.- Returns:
- true if so.
-
getPossibleResponses
Description copied from interface:IInteractionResponseHandlerGet a list of all possible responses.- Specified by:
getPossibleResponsesin interfaceIInteractionResponseHandler- Overrides:
getPossibleResponsesin classAbstractInteractionResponseHandler- Returns:
- a list of the possible responses the player can give..
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()Description copied from class:AbstractInteractionResponseHandlerSerialize the response handler to NBT.- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classServerCitizenInteraction- Returns:
- the serialized data.
-
deserializeNBT
public void deserializeNBT(@NotNull @NotNull net.minecraft.nbt.CompoundTag compoundNBT) Description copied from class:AbstractInteractionResponseHandlerDeserialize the response handler from NBT.- Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classServerCitizenInteraction
-
getType
Description copied from interface:IInteractionResponseHandlerType id used to deserialize.- Specified by:
getTypein interfaceIInteractionResponseHandler- Overrides:
getTypein classStandardInteraction- Returns:
- the string type.
-
getInteractionIcon
public net.minecraft.resources.ResourceLocation getInteractionIcon()Description copied from interface:IInteractionResponseHandlerGets the icon to render for this interaction- Returns:
- resourcelocation for icon
-
isValid
Description copied from interface:IInteractionResponseHandlerCheck if this response handler is still valid.- Specified by:
isValidin interfaceIInteractionResponseHandler- Overrides:
isValidin classServerCitizenInteraction- Parameters:
citizen- the colony the citizen is in.- Returns:
- true if still valid, else false.
-