From aea2c00a9593ed02c8142a9d65bc87114d97d301 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 19 Jun 2012 08:46:11 +0100 Subject: [PATCH] Add optional 2n'd param to temp ban reason TL key. --- .../src/com/earth2me/essentials/commands/Commandban.java | 8 ++++---- .../com/earth2me/essentials/commands/Commandtempban.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 0094e063e..01e8ab5b3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -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()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index 25c457a20..0549e9c0d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -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()) {