From becd57dcdfc9bf4d09e7930427b4a80b9cbe17f5 Mon Sep 17 00:00:00 2001 From: Pepich Date: Fri, 10 Mar 2017 15:20:41 +0100 Subject: Added warn level info message. Renamed "log" to "info" --- src/com/redstoner/misc/Utils.java | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/com/redstoner/misc/Utils.java b/src/com/redstoner/misc/Utils.java index 8973b86..8ffeea5 100644 --- a/src/com/redstoner/misc/Utils.java +++ b/src/com/redstoner/misc/Utils.java @@ -13,7 +13,7 @@ import net.md_5.bungee.api.ChatColor; /** The utils class containing utility functions. Those include but are not limited to sending formatted messages, broadcasts and more. * * @author Pepich */ -@Version(major = 1, minor = 1, revision = 8, compatible = 1) +@Version(major = 1, minor = 2, revision = 9, compatible = 1) public final class Utils { /** Hidden constructor. Do not instantiate UTILS classes! :) */ @@ -28,7 +28,7 @@ public final class Utils @Debugable public static void sendMessage(CommandSender recipient, String prefix, String message) { - Debugger.notifyMethod(recipient, message, prefix); + Debugger.notifyMethod((Object) recipient, prefix, message); if (prefix == null) prefix = "§8[§2" + getCaller() + "§8]: "; recipient.sendMessage(prefix + "§7" + message); @@ -149,11 +149,20 @@ public final class Utils } } - /** Used to make an info output to console. Supports &x color codes. + /** Deprecated. Use Utils.info(message) instead. * * @param message The message to be put into console. Prefixes are automatically generated. */ - @Debugable + @Deprecated public static void log(String message) + { + info(message); + } + + /** Prints an info message into console. + * + * @param message The message to be put into console. Prefixes are automatically generated. */ + @Debugable + public static void info(String message) { Debugger.notifyMethod(message); String classname = getCaller(); @@ -161,6 +170,15 @@ public final class Utils Bukkit.getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + "§7" + message)); } + @Debugable + public static void warn(String message) + { + Debugger.notifyMethod(message); + String classname = getCaller(); + String prefix = "§e[WARN]: §8[§2" + classname + "§8]: "; + Bukkit.getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + "§7" + message)); + } + /** Used to make an error output to console. Supports &x color codes. * * @param message The message to be put into console. Prefixes are automatically generated. Color defaults to red if not specified otherwise. */ -- cgit v1.2.3