Add optional 2n'd param to temp ban reason TL key.

This commit is contained in:
KHobbits 2012-06-19 08:46:11 +01:00
parent 3975ceb2a0
commit aea2c00a95
2 changed files with 6 additions and 6 deletions

View File

@ -40,21 +40,21 @@ public class Commandban extends EssentialsCommand
return;
}
}
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
String banReason;
if (args.length > 1)
{
banReason = _("banFormat", getFinalArg(args, 1), sender.getName());
banReason = _("banFormat", getFinalArg(args, 1), senderName);
}
else
{
banReason = _("banFormat", _("defaultBanReason"), sender.getName());
banReason = _("banFormat", _("defaultBanReason"), senderName);
}
user.setBanReason(banReason);
user.setBanned(true);
user.kickPlayer(banReason);
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
for (Player onlinePlayer : server.getOnlinePlayers())
{

View File

@ -44,12 +44,12 @@ public class Commandtempban extends EssentialsCommand
final String time = getFinalArg(args, 1);
final long banTimestamp = Util.parseDateDiff(time, true);
final String banReason = _("tempBanned", Util.formatDateDiff(banTimestamp));
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
final String banReason = _("tempBanned", Util.formatDateDiff(banTimestamp), senderName);
user.setBanReason(banReason);
user.setBanTimeout(banTimestamp);
user.setBanned(true);
user.kickPlayer(banReason);
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
for (Player onlinePlayer : server.getOnlinePlayers())
{