diff --git a/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java b/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java index 6bb3993..6e48066 100644 --- a/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java +++ b/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java @@ -385,7 +385,7 @@ public class WorldFillTask implements Runnable private void reportProgress() { lastReport = Config.Now(); - double perc = ((double)(reportTotal + reportNum) / (double)reportTarget) * 100; + double perc = getPercentageCompleted(); if (perc > 100) perc = 100; sendMessage(reportNum + " more chunks processed (" + (reportTotal + reportNum) + " total, ~" + Config.coord.format(perc) + "%" + ")"); reportTotal += reportNum; @@ -469,4 +469,31 @@ public class WorldFillTask implements Runnable { return forceLoad; } + + /** + * Get the percentage completed for the fill task. + * + * @return Percentage + */ + public double getPercentageCompleted() { + return ((double) (reportTotal + reportNum) / (double) reportTarget) * 100; + } + + /** + * Amount of chunks completed for the fill task. + * + * @return Number of chunks processed. + */ + public int getChunksCompleted() { + return reportTotal; + } + + /** + * Total amount of chunks that need to be generated for the fill task. + * + * @return Number of chunks that need to be processed. + */ + public int getChunksTotal() { + return reportTarget; + } } diff --git a/src/main/java/com/wimbli/WorldBorder/WorldTrimTask.java b/src/main/java/com/wimbli/WorldBorder/WorldTrimTask.java index 91d69cf..6be491e 100644 --- a/src/main/java/com/wimbli/WorldBorder/WorldTrimTask.java +++ b/src/main/java/com/wimbli/WorldBorder/WorldTrimTask.java @@ -391,7 +391,7 @@ public class WorldTrimTask implements Runnable private void reportProgress() { lastReport = Config.Now(); - double perc = ((double)(reportTotal) / (double)reportTarget) * 100; + double perc = getPercentageCompleted(); sendMessage(reportTrimmedRegions + " entire region(s) and " + reportTrimmedChunks + " individual chunk(s) trimmed so far (" + Config.coord.format(perc) + "% done" + ")"); } @@ -402,4 +402,31 @@ public class WorldTrimTask implements Runnable if (notifyPlayer != null) notifyPlayer.sendMessage("[Trim] " + text); } + + /** + * Get the percentage completed for the trim task. + * + * @return Percentage + */ + public double getPercentageCompleted() { + return ((double) (reportTotal) / (double) reportTarget) * 100; + } + + /** + * Amount of chunks completed for the trim task. + * + * @return Number of chunks processed. + */ + public int getChunksCompleted() { + return reportTotal; + } + + /** + * Total amount of chunks that need to be trimmed for the trim task. + * + * @return Number of chunks that need to be processed. + */ + public int getChunksTotal() { + return reportTarget; + } }