Package io.github.viimeinen1.amsg
Class aMsg.Msg
java.lang.Object
io.github.viimeinen1.amsg.aMsg.Msg
- Enclosing class:
aMsg
Non-static version of
aMsg-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.Componentprefix()Get used prefix in messages.voidprefix(@NotNull net.kyori.adventure.text.Component prefix) Set used prefix in messages.final <T> voidsend(@NotNull net.kyori.adventure.audience.Audience audience, T... content) Send message to audience.final <T> voidsend(@NotNull net.kyori.adventure.text.Component prefix, @NotNull net.kyori.adventure.audience.Audience audience, T... content) Send message to audience using custom prefix.
-
Constructor Details
-
Msg
public Msg()Create new Msg instance. Is exactly the same asaMsg, but non-static, so prefix is unique to this instance. -
Msg
public Msg(@NotNull @NotNull net.kyori.adventure.text.Component prefix) Create new Msg instance.- Parameters:
prefix- prefix of messages sent with this instance.
-
-
Method Details
-
prefix
public net.kyori.adventure.text.Component prefix()Get used prefix in messages.- Returns:
- plugin prefix
-
prefix
public void prefix(@NotNull @NotNull net.kyori.adventure.text.Component prefix) Set used prefix in messages.- Parameters:
prefix- plugin prefix
-
send
@SafeVarargs public final <T> void send(@NotNull @NotNull net.kyori.adventure.audience.Audience audience, @NotNull T... content) Send message to audience. Uses default plugin prefix.- Type Parameters:
T-Componentand/orString- Parameters:
audience- target audiencecontent- content of message
-
send
@SafeVarargs public final <T> void send(@NotNull @NotNull net.kyori.adventure.text.Component prefix, @NotNull @NotNull net.kyori.adventure.audience.Audience audience, @NotNull T... content) Send message to audience using custom prefix.- Type Parameters:
T-Componentand/orString- Parameters:
prefix- Custom prefixaudience- target audiencecontent- content of message
-