summaryrefslogtreecommitdiffstats
path: root/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-10-27 00:03:16 +0200
committersnowleo <schneeleo@gmail.com>2011-10-27 00:03:16 +0200
commit60b9d4fc80c881ce5548f7387c3de0d9fc5a7637 (patch)
treeca3fb9676c76f8700bda0bd21f9ffcc579d46c42 /EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java
parent7622c5c5108f406d3fbb285de0d2446fdc3127dd (diff)
downloadEssentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar
Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar.gz
Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar.lz
Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar.xz
Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.zip
Some cleanup, refactoring of EssentialsHelp class
Diffstat (limited to 'EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java')
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java
new file mode 100644
index 000000000..9aa932efa
--- /dev/null
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ListCommand.java
@@ -0,0 +1,32 @@
+package com.earth2me.essentials.update.chat;
+
+import org.bukkit.entity.Player;
+import org.jibble.pircbot.User;
+
+
+public class ListCommand implements Command
+{
+ @Override
+ public void run(final IrcBot ircBot, final Player player)
+ {
+ final User[] members = ircBot.getUsers();
+ final StringBuilder message = new StringBuilder();
+ for (User user : members)
+ {
+ if (message.length() > 0)
+ {
+ message.append("§f, ");
+ }
+ if (user.isOp() || user.hasVoice())
+ {
+ message.append("§6");
+ }
+ else
+ {
+ message.append("§7");
+ }
+ message.append(user.getPrefix()).append(user.getNick());
+ }
+ player.sendMessage(message.toString());
+ }
+}