Class PaperTextBody
java.lang.Object
io.github.projectunified.unidialog.paper.body.PaperTextBody
- All Implemented Interfaces:
AdventureTextBody<PaperTextBody>,AdventureSupport,TextBody<PaperTextBody>,PaperDialogBody
public class PaperTextBody
extends Object
implements AdventureTextBody<PaperTextBody>, PaperDialogBody
Represents a text dialog body for the Paper platform
-
Field Summary
Fields inherited from interface io.github.projectunified.unidialog.core.body.TextBody
DEFAULT_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionPaperTextBody(Function<String, net.kyori.adventure.text.Component> componentDeserializer) Constructor for PaperTextBody -
Method Summary
Modifier and TypeMethodDescriptionGet the deserializer function that converts a string to aComponentio.papermc.paper.registry.data.dialog.body.PlainMessageDialogBodyGet the dialog bodytext(net.kyori.adventure.text.Component text) Set the text for the bodywidth(int width) Set the width of the text bodyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.unidialog.adventure.support.AdventureSupport
deserializeMethods inherited from interface io.github.projectunified.unidialog.adventure.body.AdventureTextBody
text
-
Constructor Details
-
PaperTextBody
Constructor for PaperTextBody- Parameters:
componentDeserializer- a function to deserialize components from strings
-
-
Method Details
-
getComponentDeserializer
Description copied from interface:AdventureSupportGet the deserializer function that converts a string to aComponent- Specified by:
getComponentDeserializerin interfaceAdventureSupport- Returns:
- the function that deserializes a string into a Component
-
text
Description copied from interface:AdventureTextBodySet the text for the body- Specified by:
textin interfaceAdventureTextBody<PaperTextBody>- 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<PaperTextBody>- Parameters:
width- the width to set- Returns:
- the instance of the text body for method chaining
-
getDialogBody
public io.papermc.paper.registry.data.dialog.body.PlainMessageDialogBody getDialogBody()Description copied from interface:PaperDialogBodyGet the dialog body- Specified by:
getDialogBodyin interfacePaperDialogBody- Returns:
- the dialog body
-