Class aMsg

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
io.github.viimeinen1.amsg.aMsg
All Implemented Interfaces:
io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner, net.kyori.adventure.key.Namespaced, org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

public class aMsg extends org.bukkit.plugin.java.JavaPlugin
Messaging library with prefixes.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    final class 
    Non-static version of aMsg
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.kyori.adventure.text.Component
    mm(String message)
    Deserialize message using MiniMessage.
    static net.kyori.adventure.text.Component
    Get used prefix in messages.
    static void
    prefix(@NotNull net.kyori.adventure.text.Component prefix)
    Set used prefix in messages.
    static <T> void
    send(@NotNull net.kyori.adventure.audience.Audience audience, T... content)
    Send message to audience.
    static <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 org.bukkit.plugin.java.JavaPlugin

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onDisable, onEnable, onLoad, onTabComplete, registerCommand, registerCommand, registerCommand, registerCommand, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode, namespace

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.plugin.Plugin

    getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
  • Constructor Details

    • aMsg

      public aMsg()
      Empty constructor. All methods are static. Use aMsg.Msg if you require multiple prefixes.
  • Method Details

    • prefix

      public static net.kyori.adventure.text.Component prefix()
      Get used prefix in messages.
      Returns:
      plugin prefix
    • prefix

      public static void prefix(@NotNull @NotNull net.kyori.adventure.text.Component prefix)
      Set used prefix in messages. Prefix is global. Use aMsg.Msg if you require multiple different prefixes.
      Parameters:
      prefix - plugin prefix
    • send

      @SafeVarargs public static <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 static <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
    • mm

      public static net.kyori.adventure.text.Component mm(String message)
      Deserialize message using MiniMessage. Shortened version for MiniMessage.miniMessage().deserialize(message)
      Parameters:
      message - Message to be deserialized.
      Returns:
      deserialized message