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()) {