Package xyz.srnyx.annoyingapi.message
Class AnnoyingJSON
java.lang.Object
xyz.srnyx.annoyingapi.message.AnnoyingJSON
Class to manage and build JSON messages (
BaseComponent[])-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull AnnoyingJSON@NotNull AnnoyingJSON@NotNull AnnoyingJSONappend(@NotNull String display, @Nullable String hover, net.md_5.bungee.api.chat.ClickEvent.Action clickAction, @Nullable 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 Details
-
AnnoyingJSON
public AnnoyingJSON()Constructs a newAnnoyingJSONinstance
-
-
Method Details
-
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 String display, @Nullable @Nullable String hover, @Nullable net.md_5.bungee.api.chat.ClickEvent.Action clickAction, @Nullable @Nullable 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 String display, @Nullable @Nullable 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
- Parameters:
display- theStringto append- Returns:
- the
AnnoyingJSONinstance
-