public class Dialogue
extends java.lang.Object
Dialogue.DialogueBuilder
. To add smooth handling of choices, the
Choice.ChoiceBuilder
provides a builder setter for the handler of the eventual DialogueChoiceEvent
.
After constructing a list of Dialogue
s to show to a player, sending this data to players is
best performed by setPlayerDialogueData(ServerPlayerEntity, List, boolean)
.
Modifier and Type | Class and Description |
---|---|
static class |
Dialogue.DialogueBuilder
Builder for
Dialogue objects. |
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<Choice> |
choices
Optional list of choices to be displayed underneath the dialogue.
|
java.lang.String |
name
The name to display at the top of the dialogue box.
|
QuestProgressClient |
quest |
Constructor and Description |
---|
Dialogue(net.minecraft.network.PacketBuffer buffer)
Deprecated.
|
Dialogue(net.minecraft.network.PacketBuffer buffer,
boolean localized)
Deprecated.
|
Dialogue(net.minecraft.network.PacketBuffer buffer,
java.util.UUID quest) |
Dialogue(java.lang.String name,
java.lang.String text,
java.lang.String localizedText,
boolean escapeCloses,
java.util.ArrayList<Choice> choices) |
Modifier and Type | Method and Description |
---|---|
static Dialogue.DialogueBuilder |
builder() |
boolean |
escapeCloses() |
java.lang.String |
getText() |
void |
open(net.minecraft.entity.player.ServerPlayerEntity... players)
Opens this dialogue on the players' screens.
|
void |
open(java.util.UUID quest,
net.minecraft.entity.player.ServerPlayerEntity... players) |
static void |
setPlayerDialogueData(net.minecraft.entity.player.ServerPlayerEntity player,
java.util.List<Dialogue> dialogues,
boolean openGui)
Server-oriented method to send new dialogue data to a player, and optionally order the GUI to open.
|
static void |
setPlayerDialogueData(java.util.UUID quest,
net.minecraft.entity.player.ServerPlayerEntity player,
java.util.List<Dialogue> dialogues,
boolean openGui) |
void |
writeToBytes(net.minecraft.network.PacketBuffer buffer)
Deprecated.
|
public final java.lang.String name
public final java.util.ArrayList<Choice> choices
public QuestProgressClient quest
@Deprecated public Dialogue(net.minecraft.network.PacketBuffer buffer)
@Deprecated public Dialogue(net.minecraft.network.PacketBuffer buffer, boolean localized)
public Dialogue(net.minecraft.network.PacketBuffer buffer, java.util.UUID quest)
public Dialogue(java.lang.String name, java.lang.String text, java.lang.String localizedText, boolean escapeCloses, java.util.ArrayList<Choice> choices)
@Deprecated public void writeToBytes(net.minecraft.network.PacketBuffer buffer)
public java.lang.String getText()
public void open(net.minecraft.entity.player.ServerPlayerEntity... players)
public void open(java.util.UUID quest, net.minecraft.entity.player.ServerPlayerEntity... players)
public boolean escapeCloses()
public static void setPlayerDialogueData(net.minecraft.entity.player.ServerPlayerEntity player, java.util.List<Dialogue> dialogues, boolean openGui)
player
- - The player to send it to.dialogues
- - The list of Dialogue
s that will be shown to the player sequentially.openGui
- - Whether or not the Dialogue GUI should be opened upon receiving the data.public static void setPlayerDialogueData(java.util.UUID quest, net.minecraft.entity.player.ServerPlayerEntity player, java.util.List<Dialogue> dialogues, boolean openGui)
public static Dialogue.DialogueBuilder builder()