From 63ce4a99b9175daa95212f20e9c0b54da19db86e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 20 Jan 2013 20:35:41 +0000 Subject: Trim long /gc output, add /gc all --- .../earth2me/essentials/commands/Commandgc.java | 37 ++++++++++++++-------- Essentials/src/messages.properties | 1 + Essentials/src/messages_cs.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 3 +- Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fi.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 1 + Essentials/src/messages_pt.properties | 1 + Essentials/src/messages_se.properties | 1 + Essentials/src/plugin.yml | 2 +- 15 files changed, 38 insertions(+), 16 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 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())); + } } - + } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index d98ecb33b..359e93982 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -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} diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index ed1bb5f31..e6645a3b0 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -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} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 3f8de42a5..f6f37e189 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -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} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 5b3ce2162..f23e19a57 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -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} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 9e5e2d8b2..359e93982 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -491,4 +491,5 @@ holdFirework=\u00a74You must be holding a firework to add effects invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1} 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 \ No newline at end of file +resetBalAll=\u00a76Balance has been reset to \u00a7a{0} \u00a76for all players +messageTruncated=\u00a74Message truncated, to see the full output type:\u00a7c /{0} {1} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index cb60230e9..e61d41ffb 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -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} diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index 7f465142c..37021b744 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -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} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index d664d7d15..eb9bd09bc 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -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} diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 4bc2e2a29..496260802 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -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} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 49bb56721..0df6ca70e 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -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} diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 75c5f4d72..825eb35d6 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -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} diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index b3073ed62..69a8d2301 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -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} diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index cc33a1ea3..0ddb94081 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -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} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 0c4090918..753c9a41e 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -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: / + usage: / [all] aliases: [elag,lag,mem,memory,egc,emem,ememory,uptime,euptime] getpos: description: Get your current coordinates or those of a player. -- cgit v1.2.3