From 53878c1a6648162545ec1f787e2788754f2e3e53 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sat, 11 Oct 2014 18:35:51 +0200 Subject: [PATCH] You can't divide by 0, stupid... --- .idea/workspace.xml | 33 ++++++++++++------- .../plot/UUIDHandler.java | 13 ++++++-- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 48aa41315..de6ec31d0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -11,7 +11,6 @@ - @@ -101,9 +100,12 @@ - - - + + + + + + @@ -823,7 +825,7 @@ - + 1411382351159 @@ -941,11 +943,15 @@ 1413044690771 1413044690771 - - @@ -1014,7 +1020,6 @@ - @@ -1039,7 +1044,8 @@ - @@ -1468,9 +1474,12 @@ - - - + + + + + + diff --git a/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java b/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java index edc503a2f..9225d98f1 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/UUIDHandler.java @@ -53,9 +53,16 @@ public class UUIDHandler { } long time = System.currentTimeMillis() - start; - double 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() + int size = uuidMap.size(); + double ups; + if(time == 0l || size == 0) { + ups = size; + } else { + ups = size / time; + } + + PlotMain.sendConsoleSenderMessage("&cFinished caching of offlineplayers! Took &6" + time + "&cms (&6" + ups + "&c per millisecond), &6" + + length + " &cUUID's were cached" + " and there is now a grand total of &6" + size + " &ccached."); } });