[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
This commit is contained in:
snowleo 2011-05-01 18:37:58 +00:00
parent 013c1d8147
commit 7f34f32624

View File

@ -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)
{
sender.sendMessage("Usage: /" + commandLabel + "<reason>");
return;
}
for (Player p : server.getOnlinePlayers())
p.kickPlayer(args.length < 1 ? args[0] : "Kicked from server");
{
p.kickPlayer(args.length < 1 ? getFinalArg(args, 0) : "Kicked from server");
}
}
}