diff options
author | Pepich <benedikt.abel@yahoo.de> | 2017-03-10 15:20:41 +0100 |
---|---|---|
committer | Pepich <benedikt.abel@yahoo.de> | 2017-03-10 15:20:41 +0100 |
commit | becd57dcdfc9bf4d09e7930427b4a80b9cbe17f5 (patch) | |
tree | 3ad2c341a0d61606a627b3d8af9c39da3e68082e | |
parent | 1c9d972aa57df7287e02ba06c90aaf40a3e285c0 (diff) |
Added warn level info message. Renamed "log" to "info"
-rw-r--r-- | src/com/redstoner/misc/Utils.java | 26 |
1 files 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,18 +149,36 @@ 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(); String prefix = "§8[§2" + classname + "§8]: "; 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. */ |