Class aMsg.Msg

java.lang.Object
io.github.viimeinen1.amsg.aMsg.Msg
Enclosing class:
aMsg

public final class aMsg.Msg extends Object
Non-static version of aMsg
  • Constructor Summary

    Constructors
    Constructor
    Description
    Msg()
    Create new Msg instance.
    Msg(@NotNull net.kyori.adventure.text.Component prefix)
    Create new Msg instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.kyori.adventure.text.Component
    Get used prefix in messages.
    void
    prefix(@NotNull net.kyori.adventure.text.Component prefix)
    Set used prefix in messages.
    final <T> void
    send(@NotNull net.kyori.adventure.audience.Audience audience, T... content)
    Send message to audience.
    final <T> void
    send(@NotNull net.kyori.adventure.text.Component prefix, @NotNull net.kyori.adventure.audience.Audience audience, T... content)
    Send message to audience using custom prefix.

    Methods inherited from class java.lang.Object

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

    • Msg

      public Msg()
      Create new Msg instance. Is exactly the same as aMsg, 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 - Component and/or String
      Parameters:
      audience - target audience
      content - 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 - Component and/or String
      Parameters:
      prefix - Custom prefix
      audience - target audience
      content - content of message