1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 12:01:20 +02:00

Trim long /gc output, add /gc all

63ce4a99b9
This commit is contained in:
Chris Ward
2013-12-01 17:04:42 +11:00
parent 74dcb8e47a
commit f8e100f5b7

View File

@@ -1,12 +1,15 @@
package net.ess3.commands; package net.ess3.commands;
import java.lang.management.ManagementFactory;
import static net.ess3.I18n._;
import net.ess3.utils.DateUtil; import net.ess3.utils.DateUtil;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import java.lang.management.ManagementFactory;
import java.util.List;
import static net.ess3.I18n._;
public class Commandgc extends EssentialsCommand public class Commandgc extends EssentialsCommand
{ {
@@ -35,6 +38,14 @@ public class Commandgc extends EssentialsCommand
sender.sendMessage(_("§6Free memory:§c {0} MB.", (runtime.freeMemory() / 1024 / 1024))); sender.sendMessage(_("§6Free memory:§c {0} MB.", (runtime.freeMemory() / 1024 / 1024)));
sender.sendMessage(_("gcquene", (ess.getStorageQueue().getQueueSize()))); sender.sendMessage(_("gcquene", (ess.getStorageQueue().getQueueSize())));
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
{
for (World w : server.getWorlds()) for (World w : server.getWorlds())
{ {
final String worldType; final String worldType;
@@ -57,3 +68,4 @@ public class Commandgc extends EssentialsCommand
} }
} }
} }
}