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
  • Constructor Details

    • PaperTextBody

      public PaperTextBody(Function<String,net.kyori.adventure.text.Component> componentDeserializer)
  • Method Details

    • getComponentDeserializer

      public Function<String,net.kyori.adventure.text.Component> getComponentDeserializer()
      Description copied from interface: AdventureSupport
      Get the deserializer function that converts a string to a Component
      Specified by:
      getComponentDeserializer in interface AdventureSupport
      Returns:
      the function that deserializes a string into a Component
    • text

      public PaperTextBody text(net.kyori.adventure.text.Component text)
      Description copied from interface: AdventureTextBody
      Set the text for the body
      Specified by:
      text in interface AdventureTextBody<PaperTextBody>
      Parameters:
      text - the text to set
      Returns:
      the instance of the text body for method chaining
    • width

      public PaperTextBody width(int width)
      Description copied from interface: TextBody
      Set the width of the text body
      Specified by:
      width in interface TextBody<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()
      Specified by:
      getDialogBody in interface PaperDialogBody