Class ModuleMessages

java.lang.Object
com.ultikits.ultitools.text.internal.ModuleMessages
All Implemented Interfaces:
Messages

@Internal public final class ModuleMessages extends Object implements Messages
A lightweight view binding key construction, not rendering, to one module namespace.
  • Field Details

  • Constructor Details

  • Method Details

    • namespace

      public String namespace()
      Description copied from interface: Messages
      Returns this instance's module namespace, or ultitools for the framework.
      Specified by:
      namespace in interface Messages
    • key

      public MessageKey key(String path)
      Description copied from interface: Messages
      Returns MessageKey.of(namespace(), path).
      Specified by:
      key in interface Messages
    • render

      public net.kyori.adventure.text.Component render(Text text, Locale locale)
      Description copied from interface: Messages
      Renders in the requested locale; never throws for a missing key or translation.
      Specified by:
      render in interface Messages
    • render

      public net.kyori.adventure.text.Component render(Text text, net.kyori.adventure.audience.Audience viewer)
      Description copied from interface: Messages
      Renders using the viewer's resolved locale.
      Specified by:
      render in interface Messages
    • forEachRecipient

      public void forEachRecipient(net.kyori.adventure.audience.Audience audience, Text text, BiConsumer<? super net.kyori.adventure.audience.Audience, ? super net.kyori.adventure.text.Component> action)
      Description copied from interface: Messages
      Expands a forwarding audience with Audience.forEachAudience(java.util.function.Consumer) and invokes the action once per leaf recipient with text rendered in that recipient's locale. Never invokes the action for the forwarding audience itself. Expanding the server audience is safe from any thread: Paper iterates a copy-on-write snapshot of the online players, so a player who joins during the call may be skipped and one who quits during the call may still be passed to the action, where sending is a no-op.
      Specified by:
      forEachRecipient in interface Messages
    • shared

      public net.kyori.adventure.text.Component shared(Text text)
      Description copied from interface: Messages
      Returns text for a shared object (entity name, text display or shared boss bar). In auto mode a translated text becomes a translatable component for Paper's per-client rendering; in forced mode it is rendered server-side in the forced locale. Per-player overrides cannot apply to shared objects. Literal text remains literal. In auto mode the translatable component's fallback is the plain text rendered under LocaleResolver.fallback(), with arguments formatted in that fallback locale.
      Specified by:
      shared in interface Messages
    • isDefined

      public boolean isDefined(MessageKey key, Locale locale)
      Description copied from interface: Messages
      Returns whether the exact locale or its language defines the key, without fallback.
      Specified by:
      isDefined in interface Messages