mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 08:35:44 +01:00
Add optional 2n'd param to temp ban reason TL key.
This commit is contained in:
parent
3975ceb2a0
commit
aea2c00a95
@ -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())
|
||||
{
|
||||
|
@ -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())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user