java.lang.Object
xyz.gmitch215.socketmc.util.render.text.Text
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JsonText, PaperText, PlainText, SpigotText

public abstract class Text extends Object implements Serializable
Represents a text element to be displayed on the client's screen.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Whether this text element has a drop shadow.
    static final int
    The height of a single line of text, in pixels.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new text element.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    Gets the color as an ARGB integer.
    boolean
    Gets whether this text element has a drop shadow.
    void
    setDropShadow(boolean dropShadow)
    Sets whether this text element should have a drop shadow.
    abstract String
    Serializes this text element to a JSON string compatible with the Minecraft Component format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FONT_HEIGHT

      public static final int FONT_HEIGHT
      The height of a single line of text, in pixels.
      See Also:
    • dropShadow

      protected boolean dropShadow
      Whether this text element has a drop shadow.
  • Constructor Details

    • Text

      protected Text()
      Constructs a new text element.
  • Method Details

    • isDropShadow

      public boolean isDropShadow()
      Gets whether this text element has a drop shadow.
      Returns:
      Drop Shadow
    • setDropShadow

      public void setDropShadow(boolean dropShadow)
      Sets whether this text element should have a drop shadow.
      Parameters:
      dropShadow - Drop Shadow
    • getColor

      public abstract int getColor()
      Gets the color as an ARGB integer.
      Returns:
      String Color
    • toJSON

      public abstract String toJSON()
      Serializes this text element to a JSON string compatible with the Minecraft Component format.
      Returns:
      JSON String