mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-29 04:28:15 +01:00
Trim long /gc output, add /gc all
This commit is contained in:
parent
1ccda52e9f
commit
63ce4a99b9
@ -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;
|
||||
@ -40,7 +41,14 @@ public class Commandgc extends EssentialsCommand
|
||||
sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 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
|
||||
{
|
||||
for (World w : worlds)
|
||||
{
|
||||
String worldType = "World";
|
||||
switch (w.getEnvironment())
|
||||
@ -55,6 +63,7 @@ public class Commandgc extends EssentialsCommand
|
||||
|
||||
sender.sendMessage(_("gcWorld", worldType, w.getName(), w.getLoadedChunks().length, w.getEntities().size()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -495,3 +495,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -492,3 +492,4 @@ invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value f
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
resetBal=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all online players
|
||||
resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76 for all players
|
||||
messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1}
|
||||
|
@ -129,7 +129,7 @@ commands:
|
||||
aliases: [gm,creative,creativemode,survival,survivalmode,adventure,adventuremode,gmc,gma,gms,gmt,egamemod,eecreative,ecreativemode,esurvival,esurvivalmode,eadventure,eadventuremode,egmc,egma,egms,egm,egmt]
|
||||
gc:
|
||||
description: Reports memory, uptime and tick info.
|
||||
usage: /<command>
|
||||
usage: /<command> [all]
|
||||
aliases: [elag,lag,mem,memory,egc,emem,ememory,uptime,euptime]
|
||||
getpos:
|
||||
description: Get your current coordinates or those of a player.
|
||||
|
Loading…
Reference in New Issue
Block a user