Package io.github.viimeinen1.amsg
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.text.ComponentDeserialize message using MiniMessage.static net.kyori.adventure.text.Componentprefix()Get used prefix in messages.static voidprefix(@NotNull net.kyori.adventure.text.Component prefix) Set used prefix in messages.static <T> voidsend(@NotNull net.kyori.adventure.audience.Audience audience, T... content) Send message to audience.static <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.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, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode, namespaceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.plugin.Plugin
getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
-
Constructor Details
-
aMsg
public aMsg()Empty constructor. All methods are static. UseaMsg.Msgif 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. UseaMsg.Msgif 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-Componentand/orString- Parameters:
audience- target audiencecontent- 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-Componentand/orString- Parameters:
prefix- Custom prefixaudience- target audiencecontent- content of message
-
mm
Deserialize message using MiniMessage. Shortened version forMiniMessage.miniMessage().deserialize(message)- Parameters:
message- Message to be deserialized.- Returns:
- deserialized message
-