From 0160a39d9f019b7fdbb33debd83472f35fc6ef2e Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sat, 11 Oct 2014 18:24:50 +0200 Subject: [PATCH] I am stupid. --- .../intellectualcrafters/plot/UUIDHandler.java | 4 ++-- .../plot/commands/plugin.java | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java b/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java index 3a213c79b..77911948d 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java @@ -53,8 +53,8 @@ public class UUIDHandler { } long time = System.currentTimeMillis() - start; - long timePerUUID = time / uuidMap.size(); - PlotMain.sendConsoleSenderMessage("&cFinished caching of offlineplayers! Took &6" + time + "&cms (&6" + timePerUUID + "&c per second), &6" + long timePerUUID = uuidMap.size() / time; + PlotMain.sendConsoleSenderMessage("&cFinished caching of offlineplayers! Took &6" + time + "&cms (&6" + timePerUUID + "&c per millisecond), &6" + length + " &cUUID's were cached" + " and there is now a grand total of &6" + uuidMap.size() + " &ccached."); } diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/plugin.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/plugin.java index 68a651264..8d14bcaef 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/plugin.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/plugin.java @@ -35,15 +35,24 @@ public class plugin extends SubCommand { plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() { @Override public void run() { - downloads = - convertToNumericString(getInfo("https://intellectualsites.com/spigot_api.php?method=downloads&url=http://www.spigotmc.org/resources/plotsquared.1177/"), false); + try { + downloads = + convertToNumericString(getInfo("https://intellectualsites.com/spigot_api.php?method=downloads&url=http://www.spigotmc.org/resources/plotsquared.1177/"), false); + } catch (Exception e) { + downloads = "unknown"; + } } }, 1l); plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() { @Override public void run() { - version = - convertToNumericString(getInfo("https://intellectualsites.com/spigot_api.php?method=version&resource=1177"), true); + try { + version = + convertToNumericString(getInfo("https://intellectualsites.com/spigot_api.php?method=version&resource=1177"), true); + } catch(Exception e) { + //Let's just ignore this, most likely error 500... + version = "unknown"; + } } }, 200l); }