diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-01 18:37:58 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-01 18:37:58 +0000 |
commit | 7f34f3262424bce51d4b2450e312ee47644331d7 (patch) | |
tree | 3e4b053e214af47d8495853fb8223b141d62380f | |
parent | 013c1d8147c203bf0e76313d6a8d15212e423168 (diff) | |
download | Essentials-7f34f3262424bce51d4b2450e312ee47644331d7.tar Essentials-7f34f3262424bce51d4b2450e312ee47644331d7.tar.gz Essentials-7f34f3262424bce51d4b2450e312ee47644331d7.tar.lz Essentials-7f34f3262424bce51d4b2450e312ee47644331d7.tar.xz Essentials-7f34f3262424bce51d4b2450e312ee47644331d7.zip |
[trunk] /kickall <reason>, the reason is now optional, also fixes that only the first word is send as kick message.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1296 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkickall.java | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java index e73f57a00..d03a805d5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java @@ -16,13 +16,6 @@ public class Commandkickall extends EssentialsCommand @Override public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception { - if (args.length < 1) - { - user.sendMessage("ยง7Usage: /" + commandLabel + "<reason>"); - return; - } - - for (Player p : server.getOnlinePlayers()) { if (server.getOnlinePlayers().length == 1 && p.getName().equalsIgnoreCase(user.getName())) @@ -34,7 +27,7 @@ public class Commandkickall extends EssentialsCommand { if (!p.getName().equalsIgnoreCase(user.getName())) { - p.kickPlayer(args.length < 1 ? args[0] : "Kicked from server"); + p.kickPlayer(args.length < 1 ? getFinalArg(args, 0) : "Kicked from server"); } } } @@ -43,13 +36,9 @@ public class Commandkickall extends EssentialsCommand @Override public void run(Server server, Essentials parent, CommandSender sender, String commandLabel, String[] args) throws Exception { - if (args.length < 1) + for (Player p : server.getOnlinePlayers()) { - sender.sendMessage("Usage: /" + commandLabel + "<reason>"); - return; + p.kickPlayer(args.length < 1 ? getFinalArg(args, 0) : "Kicked from server"); } - - for (Player p : server.getOnlinePlayers()) - p.kickPlayer(args.length < 1 ? args[0] : "Kicked from server"); } } |