From da9d34118241d86fa948cf89408edc3a57f3756f Mon Sep 17 00:00:00 2001 From: Pepich Date: Tue, 9 May 2017 11:19:28 +0200 Subject: [PATCH] Fixed "external" getCaller method --- src/com/redstoner/misc/Utils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/redstoner/misc/Utils.java b/src/com/redstoner/misc/Utils.java index 1ee7a27..34922be 100644 --- a/src/com/redstoner/misc/Utils.java +++ b/src/com/redstoner/misc/Utils.java @@ -16,7 +16,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 = 3, revision = 3, compatible = 1) +@Version(major = 1, minor = 3, revision = 4, compatible = 1) public final class Utils { /** The SimpleDateFormat used for getting the current date. */ @@ -226,7 +226,7 @@ public final class Utils { StackTraceElement[] stackTrace = (new Exception()).getStackTrace(); String classname = (directCaller == null ? "Utils" : directCaller.getName()); - for (int i = 0; classname.equals(directCaller.getName()); i++) + for (int i = 0; classname.equals(directCaller.getName()) || classname.equals("Utils"); i++) { classname = stackTrace[i].getClassName().replaceAll(".*\\.", ""); }