diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-06-19 08:46:11 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-06-19 08:46:33 +0100 |
commit | aea2c00a9593ed02c8142a9d65bc87114d97d301 (patch) | |
tree | 3347718a7ec6216669d8b2f3681e83f75fa9abe7 | |
parent | 3975ceb2a02dddd5bba43cd4d7148bfd4d7125ab (diff) | |
download | Essentials-aea2c00a9593ed02c8142a9d65bc87114d97d301.tar Essentials-aea2c00a9593ed02c8142a9d65bc87114d97d301.tar.gz Essentials-aea2c00a9593ed02c8142a9d65bc87114d97d301.tar.lz Essentials-aea2c00a9593ed02c8142a9d65bc87114d97d301.tar.xz Essentials-aea2c00a9593ed02c8142a9d65bc87114d97d301.zip |
Add optional 2n'd param to temp ban reason TL key.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandban.java | 8 | ||||
-rw-r--r-- | Essentials/src/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()) { |