Made it so scanned types from multiple dimensions stack.

This commit is contained in:
Brianna 2021-02-25 08:37:55 -06:00
parent e79ccd87ef
commit af42740fc5
2 changed files with 9 additions and 2 deletions

View File

@ -56,7 +56,7 @@ public final class IslandScan extends BukkitRunnable {
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> initScan(plugin));
else
initScan(plugin);
return this;
}

View File

@ -46,7 +46,14 @@ public class QueuedIslandScan {
this.executions += currentScan.getExecutions();
this.totalScanned += currentScan.getTotalScanned();
this.blocksSize += currentScan.getBlocksSize();
this.amounts.putAll(currentScan.getAmounts());
for (Map.Entry<CompatibleMaterial, BlockAmount> entry : currentScan.getAmounts().entrySet()) {
if (amounts.containsKey(entry.getKey())) {
amounts.get(entry.getKey()).increaseAmount(entry.getValue().getAmount());
} else {
amounts.put(entry.getKey(), entry.getValue());
}
}
}
public boolean scan() {