Class TextBuilder

java.lang.Object
xyz.gmitch215.socketmc.instruction.builder.TextBuilder
All Implemented Interfaces:
HUDBuilder<TextBuilder>, InstructionBuilder

public final class TextBuilder extends Object implements HUDBuilder<TextBuilder>
  • Method Details

    • x

      public TextBuilder x(int x)
      Description copied from interface: HUDBuilder
      Sets the X coordinate of the element.
      Specified by:
      x in interface HUDBuilder<TextBuilder>
      Parameters:
      x - X coordinate, in pixels
      Returns:
      this class, for chaining
    • y

      public TextBuilder y(int y)
      Description copied from interface: HUDBuilder
      Sets the Y coordinate of the element.
      Specified by:
      y in interface HUDBuilder<TextBuilder>
      Parameters:
      y - Y coordinate, in pixels
      Returns:
      this class, for chaining
    • argb

      public TextBuilder argb(int color)
      Description copied from interface: HUDBuilder
      Sets the color of the element using ARGB format.
      Specified by:
      argb in interface HUDBuilder<TextBuilder>
      Parameters:
      color - Color in ARGB
      Returns:
      this class, for chaining
    • duration

      public TextBuilder duration(long millis)
      Description copied from interface: HUDBuilder
      Sets the duration the element should be displayed for.
      Specified by:
      duration in interface HUDBuilder<TextBuilder>
      Parameters:
      millis - Duration, in milliseconds
      Returns:
      this class, for chaining
    • text

      Sets the text to be displayed.
      Parameters:
      text - Text
      Returns:
      this class, for chaining
    • dropShadow

      @NotNull public @NotNull TextBuilder dropShadow(boolean dropShadow)
      Sets whether the text should have a drop shadow.
      Parameters:
      dropShadow - Drop shadow
      Returns:
      this class, for chaining
    • build

      @NotNull public @NotNull Instruction build()
      Description copied from interface: InstructionBuilder
      Builds the instruction.
      Specified by:
      build in interface InstructionBuilder
      Returns:
      Constructed Instruction for this Builder