0

Updated API to version 3.2

This commit is contained in:
Pepich 2017-05-05 09:21:19 +02:00
parent 205cdb2d86
commit 1ee4a123d2
2 changed files with 18 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import com.redstoner.misc.mysql.MysqlHandler;
/** Main class. Duh.
*
* @author Pepich */
@Version(major = 3, minor = 1, revision = 1, compatible = -1)
@Version(major = 3, minor = 2, revision = 0, compatible = -1)
public class Main extends JavaPlugin
{
public static JavaPlugin plugin;

View File

@ -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 = 2, revision = 13, compatible = 1)
@Version(major = 1, minor = 3, revision = 0, compatible = 1)
public final class Utils
{
/** The SimpleDateFormat used for getting the current date. */
@ -202,7 +202,7 @@ public final class Utils
/** This method will find the next parent caller and return their class name, omitting package names.
*
* @return */
* @return the Name of the calling class. */
private static final String getCaller()
{
StackTraceElement[] stackTrace = (new Exception()).getStackTrace();
@ -214,6 +214,21 @@ public final class Utils
return classname;
}
/** This method will find the next parent caller and return their class name, omitting package names.
*
* @param directCaller used to prevent this method from returning the caller itself. Null if supposed to be ignored.
* @return the name of the calling class. */
public static final String getCaller(Class<? extends Object> directCaller)
{
StackTraceElement[] stackTrace = (new Exception()).getStackTrace();
String classname = (directCaller == null ? "Utils" : directCaller.getName());
for (int i = 0; classname.equals(directCaller.getName()); i++)
{
classname = stackTrace[i].getClassName().replaceAll(".*\\.", "");
}
return classname;
}
/** Displays the module header to the recipient.</br>
* Format: &2--=[ %MODULE% ]=--
*