diff --git a/src/de/anura/core/API/Core.java b/src/de/anura/core/API/Core.java index e8f4176..033f354 100644 --- a/src/de/anura/core/API/Core.java +++ b/src/de/anura/core/API/Core.java @@ -195,6 +195,10 @@ public class Core { return AnuraCore.getInstance(); } + /** + * Makes a player stand up + * @param P The player to end the sitting of + */ public static void endSitting(Player P) { try { if (getMainClass().sittingPlayer.containsKey(P)) { @@ -220,11 +224,16 @@ public class Core { } } + /** + * Method to check if a given string can be converted into an integer + * @param s The string to check + * @return If the given string is an integer + */ public static boolean isInteger(String s) { return isInteger(s, 10); } - public static boolean isInteger(String s, int radix) { + private static boolean isInteger(String s, int radix) { if (s.isEmpty()) { return false; } @@ -243,10 +252,18 @@ public class Core { return true; } + /** + * Returns the level class object + * @return The level class object + */ public static Level getLevel() { return getMainClass().level; } + /** + * Moves a given player to the hub + * @param P The player to move to the hub + */ public static void kickToLobby(Player P) { try { ByteArrayOutputStream b = new ByteArrayOutputStream(); @@ -259,6 +276,10 @@ public class Core { } } + /** + * Returns the current set spawn + * @return The spawn for this server + */ public static Location getServerSpawn() { FileConfiguration c = getMainClass().getConfig(); Location loc = null; @@ -272,6 +293,11 @@ public class Core { return loc; } + /** + * Teleports a player to the current set serverspawn + * Get serverspawn with {@link getServerSpawn()} + * @param P The player to move to the spawn + */ public static void toSpawn(Player P) { P.teleport(getServerSpawn()); } diff --git a/src/de/anura/core/API/Errors.java b/src/de/anura/core/API/Errors.java index bc7c205..96f0031 100644 --- a/src/de/anura/core/API/Errors.java +++ b/src/de/anura/core/API/Errors.java @@ -8,6 +8,11 @@ import org.bukkit.entity.Player; public class Errors { + /** + * Reports an exception to the database + * @param exc A Throwable to get the error data from + * @param info Some additional info + */ public static void reportException(Throwable exc, String info) { if (Core.getMySql() == null) { System.err.println("FATAL ERROR: Error handler fired before init of mysql connection!!"); @@ -39,10 +44,20 @@ public class Errors { } } + /** + * Reports an exception to the database + * @param exc A Throwable to get the error from + */ public static void reportException(Throwable exc) { reportException(exc, ""); } + /** + * Method to report a bug + * @param P The reporter + * @param msg A message from the reporter + * @param data An array of error entries generated by {@link make(String, Object)} + */ public static void bugReport(Player P, String msg, Entry... data) { UUID uuid = P.getUniqueId(); String dataText = ""; @@ -52,6 +67,12 @@ public class Errors { Core.getMySql().queryUpdate("INSERT INTO serverBugs(player, msg, data, timestamp) VALUES ((SELECT id FROM players WHERE uuid = '" + uuid.toString() + "'), '" + Core.getMySql().escapeString(msg) + "', '" + dataText + "', '" + System.currentTimeMillis() / 1000 + "')"); } + /** + * Generates an error entry + * @param key The key for this object + * @param value Any object to use as value + * @return The error entry to give to + */ public static Entry make(String key, Object value) { return new AbstractMap.SimpleEntry<>(key, value); }