public class DialogueChoiceEvent
extends net.minecraftforge.eventbus.api.Event
DialogueNextActionPacket.DialogueGuiAction.NEW_DIALOGUES
or
DialogueNextActionPacket.DialogueGuiAction.INSERT_DIALOGUES
is returned then there is an
assumption that newDialogues
is both non-null and non-empty.
By default, the response will be to continue with any remaining dialogue
that has been queued on the client. If none remains, it behaves the same
as a response with DialogueNextActionPacket.DialogueGuiAction.CLOSE
.
If dialogue choices were provided with handles during building, explicitly handling this event is unnecessary as the handles will execute automatically.
Modifier and Type | Field and Description |
---|---|
Choice |
choice
The choice that was selected.
|
net.minecraft.entity.player.ServerPlayerEntity |
player
The player who made the dialogue choice.
|
Constructor and Description |
---|
DialogueChoiceEvent(net.minecraft.entity.player.ServerPlayerEntity player,
Choice choice) |
Modifier and Type | Method and Description |
---|---|
DialogueChoiceEvent |
addDialogue(Dialogue newDialogue) |
DialogueNextActionPacket.DialogueGuiAction |
getAction() |
java.util.ArrayList<Dialogue> |
getNewDialogues() |
void |
reply(boolean insert,
Dialogue... dialogues)
Simple shortcut to send dialogues back to the player.
|
void |
reply(Dialogue... dialogues)
Simple shortcut to send dialogues back to the player.
|
void |
reply(java.lang.String name,
java.lang.String... texts)
Simple shortcut to send dialogues back to the player.
|
void |
setAction(DialogueNextActionPacket.DialogueGuiAction action) |
void |
setNewDialogues(java.util.ArrayList<Dialogue> newDialogues) |
public final net.minecraft.entity.player.ServerPlayerEntity player
public DialogueChoiceEvent(net.minecraft.entity.player.ServerPlayerEntity player, Choice choice)
public DialogueNextActionPacket.DialogueGuiAction getAction()
public void setAction(DialogueNextActionPacket.DialogueGuiAction action)
public DialogueChoiceEvent addDialogue(Dialogue newDialogue)
public void setNewDialogues(java.util.ArrayList<Dialogue> newDialogues)
public java.util.ArrayList<Dialogue> getNewDialogues()
public void reply(Dialogue... dialogues)
reply(boolean, Dialogue...)
.public void reply(boolean insert, Dialogue... dialogues)
insert
- - Whether or not it should use insertion. If false, this will replace all previous dialogue. if
true, this will put the given dialogue at the beginning of the queue.public void reply(java.lang.String name, java.lang.String... texts)