Skip to content

Commit

Permalink
Correct check index printouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikoo committed Oct 17, 2019
1 parent f752731 commit 7ee1cf2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class DeletionRunnable extends BukkitRunnable {
@Override
public void run() {
if (index >= regions.length - 1) {
--index;
plugin.getLogger().info("Regeneration cycle complete for " + getRunStats());
nextRun = System.currentTimeMillis() + plugin.getMillisecondsBetweenDeletionCycles();
this.cancel();
Expand All @@ -59,7 +60,7 @@ public void run() {

++index;
plugin.debug(DebugLevel.HIGH, () -> String.format("Checking %s:%s (%s/%s)",
world.getName(), regions[index].getRegionFile().getName(), index, regions.length));
world.getName(), regions[index].getRegionFile().getName(), index + 1, regions.length));
}

if (!regions[index].isPopulated()) {
Expand Down Expand Up @@ -96,13 +97,13 @@ public void run() {
}
}

if (index > 0 && index % 20 == 0) {
if (index > 0 && (index + 1) % 20 == 0) {
plugin.debug(DebugLevel.LOW, this::getRunStats);
}
}

String getRunStats() {
return String.format(STATS_FORMAT, world.getName(), index, regions.length, regionsDeleted, chunksDeleted);
return String.format(STATS_FORMAT, world.getName(), index + 1, regions.length, regionsDeleted, chunksDeleted);
}

long getNextRun() {
Expand Down

0 comments on commit 7ee1cf2

Please sign in to comment.