Class AnnoyingJSON


  • public class AnnoyingJSON
    extends java.lang.Object
    Class to manage and build JSON messages (BaseComponent[])
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull AnnoyingJSON append​(@NotNull java.lang.String display)
      Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance
      @NotNull AnnoyingJSON append​(@NotNull java.lang.String display, @Nullable java.lang.String hover)
      Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance
      @NotNull AnnoyingJSON append​(@NotNull java.lang.String display, @Nullable java.lang.String hover, net.md_5.bungee.api.chat.ClickEvent.Action clickAction, @Nullable java.lang.String clickValue)
      Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance
      @NotNull AnnoyingJSON append​(@NotNull net.md_5.bungee.api.chat.BaseComponent component)
      Appends a BaseComponent to the message
      @NotNull net.md_5.bungee.api.chat.BaseComponent[] build()
      Converts the components to a BaseComponent array and returns it
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnnoyingJSON

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

      • 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 java.lang.String display,
                                            @Nullable
                                            @Nullable java.lang.String hover,
                                            @Nullable
                                            net.md_5.bungee.api.chat.ClickEvent.Action clickAction,
                                            @Nullable
                                            @Nullable java.lang.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 java.lang.String display,
                                            @Nullable
                                            @Nullable java.lang.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 java.lang.String display)
        Appends a String (ChatColors translated) to the ComponentBuilder of the AnnoyingJSON instance
        Parameters:
        display - the String to append
        Returns:
        the AnnoyingJSON instance