summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgc.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
index 42931feff..db4432351 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
@@ -6,6 +6,8 @@ import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.NumberUtil;
import java.lang.management.ManagementFactory;
import java.util.List;
+import java.util.logging.Level;
+import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Server;
@@ -56,11 +58,19 @@ public class Commandgc extends EssentialsCommand
worldType = "The End";
break;
}
-
+
int tileEntities = 0;
-
- for (Chunk chunk : w.getLoadedChunks()) {
- tileEntities += chunk.getTileEntities().length;
+
+ try
+ {
+ for (Chunk chunk : w.getLoadedChunks())
+ {
+ tileEntities += chunk.getTileEntities().length;
+ }
+ }
+ catch (java.lang.ClassCastException ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, "Corrupted chunk data on world " + w, ex);
}
sender.sendMessage(tl("gcWorld", worldType, w.getName(), w.getLoadedChunks().length, w.getEntities().size(), tileEntities));