diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-11-18 12:06:59 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-11-18 12:06:59 +0000 |
commit | e54d73704e9fb99b99324c5407c6bfddac860a26 (patch) | |
tree | e5fadd64f907a7701192751eaf6d4c81fdd52a23 /Essentials/src/com/earth2me/essentials/commands/Commandkick.java | |
parent | e5c77c1aeb2d7e8571061778f2612c2a65c6a8b9 (diff) | |
download | Essentials-e54d73704e9fb99b99324c5407c6bfddac860a26.tar Essentials-e54d73704e9fb99b99324c5407c6bfddac860a26.tar.gz Essentials-e54d73704e9fb99b99324c5407c6bfddac860a26.tar.lz Essentials-e54d73704e9fb99b99324c5407c6bfddac860a26.tar.xz Essentials-e54d73704e9fb99b99324c5407c6bfddac860a26.zip |
Command cleanup
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandkick.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkick.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java index fd0d4a8e0..039badc80 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -14,30 +14,30 @@ public class Commandkick extends EssentialsCommand { super("kick"); } - + @Override - public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } - - User player = getPlayer(server, args, 0); - if (player.isAuthorized("essentials.kick.exempt")) + + final User user = getPlayer(server, args, 0); + if (user.isAuthorized("essentials.kick.exempt")) { throw new Exception(Util.i18n("kickExempt")); } final String kickReason = args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault"); - player.kickPlayer(kickReason); - String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; - - for(Player p : server.getOnlinePlayers()) + user.kickPlayer(kickReason); + final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + + for(Player onlinePlayer : server.getOnlinePlayers()) { - User u = ess.getUser(p); - if(u.isAuthorized("essentials.kick.notify")) + User player = ess.getUser(onlinePlayer); + if(player.isAuthorized("essentials.kick.notify")) { - p.sendMessage(Util.format("playerKicked", senderName, player.getName(), kickReason)); + onlinePlayer.sendMessage(Util.format("playerKicked", senderName, user.getName(), kickReason)); } } } |