Class ViaTextBody
java.lang.Object
io.github.projectunified.unidialog.viaversion.body.ViaTextBody
- All Implemented Interfaces:
TextBody<ViaTextBody>,ViaDialogBody
A ViaVersion-based implementation of
TextBody for building text bodies.-
Field Summary
Fields inherited from interface io.github.projectunified.unidialog.core.body.TextBody
DEFAULT_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViaTextBody(Function<String, com.viaversion.viaversion.libs.mcstructs.text.TextComponent> componentDeserializer) Constructor for ViaTextBody -
Method Summary
Modifier and TypeMethodDescriptiontext(com.viaversion.viaversion.libs.mcstructs.text.TextComponent text) Set the text for the bodySet the text for the bodycom.viaversion.nbt.tag.CompoundTagtoTag(com.viaversion.viaversion.util.SerializerVersion baseVersion, com.viaversion.viaversion.util.SerializerVersion targetVersion) Serialize this body for the given base and target serializerswidth(int width) Set the width of the text body
-
Constructor Details
-
Method Details
-
text
Set the text for the body- Parameters:
text- the text- Returns:
- the text body itself for method chaining
-
text
Description copied from interface:TextBodySet the text for the body- Specified by:
textin interfaceTextBody<ViaTextBody>- Parameters:
text- the text to set- Returns:
- the instance of the text body for method chaining
-
width
Description copied from interface:TextBodySet the width of the text body- Specified by:
widthin interfaceTextBody<ViaTextBody>- Parameters:
width- the width to set- Returns:
- the instance of the text body for method chaining
-
toTag
public com.viaversion.nbt.tag.CompoundTag toTag(com.viaversion.viaversion.util.SerializerVersion baseVersion, com.viaversion.viaversion.util.SerializerVersion targetVersion) Description copied from interface:ViaDialogBodySerialize this body for the given base and target serializers- Specified by:
toTagin interfaceViaDialogBody- Parameters:
baseVersion- the serializer of the server version the dialog is created fortargetVersion- the serializer of the version the dialog is sent to- Returns:
- the dialog body tag
-