summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandgc.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgc.java37
1 files changed, 23 insertions, 14 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
index 56816d452..3595603ce 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Util;
import java.lang.management.ManagementFactory;
+import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.World;
@@ -33,28 +34,36 @@ public class Commandgc extends EssentialsCommand
{
color = ChatColor.RED;
}
-
+
sender.sendMessage(_("uptime", Util.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())));
sender.sendMessage(_("tps", "" + color + tps));
sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
- sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
+ sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
- for (World w : server.getWorlds())
+ List<World> worlds = server.getWorlds();
+ if (worlds.size() > 3 && args.length == 0)
+ {
+ sender.sendMessage(_("messageTruncated", commandLabel, "all"));
+ }
+ else
{
- String worldType = "World";
- switch (w.getEnvironment())
+ for (World w : worlds)
{
- case NETHER:
- worldType = "Nether";
- break;
- case THE_END:
- worldType = "The End";
- break;
- }
+ String worldType = "World";
+ switch (w.getEnvironment())
+ {
+ case NETHER:
+ worldType = "Nether";
+ break;
+ case THE_END:
+ worldType = "The End";
+ break;
+ }
- sender.sendMessage(_("gcWorld", worldType, w.getName(), w.getLoadedChunks().length, w.getEntities().size()));
+ sender.sendMessage(_("gcWorld", worldType, w.getName(), w.getLoadedChunks().length, w.getEntities().size()));
+ }
}
-
+
}
}