Package xyz.srnyx.annoyingapi.message
Class AnnoyingJSON
- java.lang.Object
-
- xyz.srnyx.annoyingapi.message.AnnoyingJSON
-
public class AnnoyingJSON extends java.lang.ObjectClass to manage and build JSON messages (BaseComponent[])
-
-
Constructor Summary
Constructors Constructor Description AnnoyingJSON()Constructs a newAnnoyingJSONinstance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull AnnoyingJSONappend(@NotNull java.lang.String display)@NotNull AnnoyingJSONappend(@NotNull java.lang.String display, @Nullable java.lang.String hover)@NotNull AnnoyingJSONappend(@NotNull java.lang.String display, @Nullable java.lang.String hover, net.md_5.bungee.api.chat.ClickEvent.Action clickAction, @Nullable java.lang.String clickValue)@NotNull AnnoyingJSONappend(@NotNull net.md_5.bungee.api.chat.BaseComponent component)Appends aBaseComponentto the message@NotNull net.md_5.bungee.api.chat.BaseComponent[]build()Converts thecomponentsto aBaseComponentarray and returns it
-
-
-
Constructor Detail
-
AnnoyingJSON
public AnnoyingJSON()
Constructs a newAnnoyingJSONinstance
-
-
Method Detail
-
build
@NotNull public @NotNull net.md_5.bungee.api.chat.BaseComponent[] build()
Converts thecomponentsto aBaseComponentarray and returns it- Returns:
- the
componentsas an array
-
append
@NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent component)
Appends aBaseComponentto the message- Parameters:
component- theBaseComponentto append- Returns:
- the
AnnoyingJSONinstance
-
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 aString(ChatColors translated) to theComponentBuilderof theAnnoyingJSONinstanceAlso sets the
HoverEventandClickEventof the appendedTextComponent- Parameters:
display- theStringto appendhover- theHoverEventvalue to setclickAction- theClickEvent.Actionto setclickValue- theClickEventvalue to set- Returns:
- the
AnnoyingJSONinstance
-
append
@NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull java.lang.String display, @Nullable @Nullable java.lang.String hover)
Appends aString(ChatColors translated) to theComponentBuilderof theAnnoyingJSONinstanceAlso sets the
HoverEventof the appendedTextComponent- Parameters:
display- theStringto appendhover- theHoverEventtext to set- Returns:
- the
AnnoyingJSONinstance
-
append
@NotNull public @NotNull AnnoyingJSON append(@NotNull @NotNull java.lang.String display)
- Parameters:
display- theStringto append- Returns:
- the
AnnoyingJSONinstance
-
-