summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/net/ess3/commands/Commandgc.java46
1 files changed, 29 insertions, 17 deletions
diff --git a/Essentials/src/net/ess3/commands/Commandgc.java b/Essentials/src/net/ess3/commands/Commandgc.java
index 710ee2216..edda5790e 100644
--- a/Essentials/src/net/ess3/commands/Commandgc.java
+++ b/Essentials/src/net/ess3/commands/Commandgc.java
@@ -1,12 +1,15 @@
package net.ess3.commands;
-import java.lang.management.ManagementFactory;
-import static net.ess3.I18n._;
import net.ess3.utils.DateUtil;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
+import java.lang.management.ManagementFactory;
+import java.util.List;
+
+import static net.ess3.I18n._;
+
public class Commandgc extends EssentialsCommand
{
@@ -35,25 +38,34 @@ public class Commandgc extends EssentialsCommand
sender.sendMessage(_("§6Free memory:§c {0} MB.", (runtime.freeMemory() / 1024 / 1024)));
sender.sendMessage(_("gcquene", (ess.getStorageQueue().getQueueSize())));
- for (World w : server.getWorlds())
+ List<World> worlds = server.getWorlds();
+
+ if(worlds.size() > 3 && args.length == 0)
+ {
+ sender.sendMessage(_("§4Message truncated, to see the full output type:§c /{0} all", commandLabel));
+ }
+ else
{
- final String worldType;
- switch (w.getEnvironment())
+ for (World w : server.getWorlds())
{
- case NETHER:
- worldType = "Nether";
- break;
- case THE_END:
- worldType = "The End";
- break;
- default:
- worldType = "World";
- break;
+ final String worldType;
+ switch (w.getEnvironment())
+ {
+ case NETHER:
+ worldType = "Nether";
+ break;
+ case THE_END:
+ worldType = "The End";
+ break;
+ default:
+ worldType = "World";
+ break;
- }
+ }
- sender.sendMessage(
- worldType + " \"" + w.getName() + "\": " + w.getLoadedChunks().length + _("gcchunks") + w.getEntities().size() + _("gcentities"));
+ sender.sendMessage(
+ worldType + " \"" + w.getName() + "\": " + w.getLoadedChunks().length + _("gcchunks") + w.getEntities().size() + _("gcentities"));
+ }
}
}
}