Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Double bugfix - world, chunklist.
Browse files Browse the repository at this point in the history
- World "world" may not even exist.
- Chunklist may be zero, but that won't break here
- Count all chunks in all enabled worlds.
  • Loading branch information
ahkok committed Jan 13, 2014
1 parent 9e19937 commit 263e143
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/org/foo_projects/sofar/Sedimentology/Sedimentology.java
Original file line number Diff line number Diff line change
Expand Up @@ -1143,14 +1143,15 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
msg = "disabled for world \"" + split[1] + "\"";
break;
case "stats":
World world = org.bukkit.Bukkit.getWorld("world");
Chunk ChunkList[] = world.getLoadedChunks();
long chunks = 0;
for (SedWorld sw: sedWorldList)
chunks += sw.world.getLoadedChunks().length;
msg = String.format("blocks: %d snowblocks: %d ticks: %d protect: %s\n" +
"considered %d, displaced %d, degraded %d blocks in %d chunks %d errors\nlast one at %d %d %d\n" +
"ignored: edge %d, type %d, storm %d, vegetation %d, resistance %d, water %d, wave %d, sand %d, hardness %d, " +
"protected %d, locked in %d, rate %d",
conf_blocks, conf_snowblocks, conf_ticks, conf_protect ? "true" : "false",
stat_considered, stat_displaced, stat_degraded, ChunkList.length, stat_errors,
stat_considered, stat_displaced, stat_degraded, chunks, stat_errors,
stat_lastx, stat_lasty, stat_lastz,
stat_ignored_edge, stat_ignored_type, stat_ignored_storm, stat_ignored_vegetation,
stat_ignored_resistance, stat_ignored_water, stat_ignored_wave, stat_ignored_sand, stat_ignored_hardness,
Expand Down

0 comments on commit 263e143

Please sign in to comment.