Class ExtensionMessages

java.lang.Object
com.booksaw.betterTeams.extension.ExtensionMessages

public class ExtensionMessages extends Object
  • Constructor Details

    • ExtensionMessages

      public ExtensionMessages(@NotNull @NotNull BetterTeamsExtension extension, @NotNull @NotNull String fileName)
  • Method Details

    • reload

      public void reload(@NotNull @NotNull String fileName)
      Reloads messages from a different file
      Parameters:
      fileName - The new file name (without .yml extension)
    • reload

      public void reload()
    • get

      @NotNull public @NotNull String get(@NotNull @NotNull String path)
      Gets a raw string from config with color codes translated
      Parameters:
      path - The path in messages file
      Returns:
      The formatted message, or an empty string if not found
    • get

      @NotNull public @NotNull String get(@NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Gets a message with placeholders replaced
    • getPrefix

      @NotNull public @NotNull String getPrefix()
    • getWithPrefix

      @NotNull public @NotNull String getWithPrefix(@NotNull @NotNull String path)
    • getWithPrefix

      @NotNull public @NotNull String getWithPrefix(@NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Gets a message with the prefix and placeholders replaced
    • toStatic

      @NotNull public @NotNull StaticMessage toStatic(@NotNull @NotNull String path)
      Creates a StaticMessage for use in BetterTeams commands Includes the prefix
      Parameters:
      path - The message path
      Returns:
      A StaticMessage instance
    • toStatic

      @NotNull public @NotNull StaticMessage toStatic(@NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Creates a StaticMessage with placeholders replaced Includes the prefix
      Parameters:
      path - The message path
      replacements - Pairs of key-value replacements
      Returns:
      A StaticMessage instance
    • toStaticRaw

      @NotNull public @NotNull StaticMessage toStaticRaw(@NotNull @NotNull String path)
      Creates a StaticMessage without prefix
    • toStaticRaw

      @NotNull public @NotNull StaticMessage toStaticRaw(@NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Creates a StaticMessage without prefix but with placeholders
    • response

      @NotNull public @NotNull CommandResponse response(boolean success, @NotNull @NotNull String path)
      Creates a CommandResponse with custom success state Includes the prefix
      Parameters:
      success - Whether the command was successful
      path - The message path
      Returns:
      A CommandResponse instance
    • response

      @NotNull public @NotNull CommandResponse response(boolean success, @NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Creates a CommandResponse with custom success state and placeholders Includes the prefix
      Parameters:
      success - Whether the command was successful
      path - The message path
      replacements - Pairs of key-value replacements
      Returns:
      A CommandResponse instance
    • send

      public void send(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String path)
      Sends a message directly to a CommandSender with prefix
      Parameters:
      sender - The recipient
      path - The message path
    • send

      public void send(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Sends a message directly to a CommandSender with prefix and placeholders
      Parameters:
      sender - The recipient
      path - The message path
      replacements - Pairs of key-value replacements
    • send

      public void send(@NotNull @NotNull Collection<? extends org.bukkit.command.CommandSender> recipients, @NotNull @NotNull String path)
      Sends a message directly to multiple CommandSenders with prefix
      Parameters:
      recipients - The recipients
      path - The message path
    • send

      public void send(@NotNull @NotNull Collection<? extends org.bukkit.command.CommandSender> recipients, @NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Sends a message directly to multiple CommandSenders with prefix and placeholders
      Parameters:
      recipients - The recipients
      path - The message path
      replacements - Pairs of key-value replacements
    • sendRaw

      public void sendRaw(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String path)
      Sends a raw message (no prefix) directly to a CommandSender
      Parameters:
      sender - The recipient
      path - The message path
    • sendRaw

      public void sendRaw(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String path, @NotNull @NotNull Object... replacements)
      Sends a raw message (no prefix) directly to a CommandSender with placeholders
      Parameters:
      sender - The recipient
      path - The message path
      replacements - Pairs of key-value replacements
    • has

      public boolean has(@NotNull @NotNull String path)
      Checks if a message key exists in the configuration
    • clearCache

      public void clearCache()
    • getCacheSize

      public int getCacheSize()
    • builder

      public MessageConfig.MessageBuilder builder(String path)
    • getMessageService

      public MessageService getMessageService()
    • getExtension

      public BetterTeamsExtension getExtension()
    • getFileName

      public String getFileName()