Class AnnoyingJSON

java.lang.Object
xyz.srnyx.annoyingapi.message.AnnoyingJSON

public class AnnoyingJSON extends Object
Class to manage and build JSON messages (BaseComponent[])
  • Constructor Details

    • AnnoyingJSON

      public AnnoyingJSON()
      Constructs a new AnnoyingJSON instance
  • Method Details

    • build

      @NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent[] build()
      Converts the components to a BaseComponent array and returns it
      Returns:
      the components as an array
    • append

      @NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent component)
      Appends a BaseComponent to the message
      Parameters:
      component - the BaseComponent to append
      Returns:
      the AnnoyingJSON instance
    • append

      @NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull String display, @Nullable @Nullable String hover, @Nullable net.md_5.bungee.api.chat.ClickEvent.Action clickAction, @Nullable @Nullable String clickValue)
      Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance

      Also sets the HoverEvent and ClickEvent of the appended TextComponent

      Parameters:
      display - the String to append
      hover - the HoverEvent value to set
      clickAction - the ClickEvent.Action to set
      clickValue - the ClickEvent value to set
      Returns:
      the AnnoyingJSON instance
    • append

      @NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull String display, @Nullable @Nullable String hover)
      Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance

      Also sets the HoverEvent of the appended TextComponent

      Parameters:
      display - the String to append
      hover - the HoverEvent text to set
      Returns:
      the AnnoyingJSON instance
    • append

      @NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull String display)
      Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance
      Parameters:
      display - the String to append
      Returns:
      the AnnoyingJSON instance