mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 03:04:57 +00:00
Fixed mixed string concatenation / String.format usage.
Doesn't make much sense to use string concatenation and a String.format to generate the same output. I believe this method is much more readable.
This commit is contained in:
parent
2c92b0874e
commit
4988140268
1 changed files with 7 additions and 1 deletions
|
@ -77,7 +77,13 @@ public class Command_gtfo extends TFM_Command
|
|||
|
||||
// ban IP address:
|
||||
String ip = TFM_Util.getFuzzyIp(player.getAddress().getAddress().getHostAddress());
|
||||
TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", player.getName(), ip) + ChatColor.RED + (reason != null ? ("Reason: " + ChatColor.YELLOW + reason) : ""));
|
||||
|
||||
final StringBuilder bcast = new StringBuilder("Banning: ").append(player.getName()).append(", IP: ").append(ip);
|
||||
if (reason != null)
|
||||
{
|
||||
bcast.append(ChatColor.RED).append(" - Reason: ").append(ChatColor.YELLOW).append(reason);
|
||||
}
|
||||
TFM_Util.bcastMsg(bcast.toString());
|
||||
|
||||
TFM_BanManager.addIpBan(new TFM_Ban(ip, player.getName(), sender.getName(), null, reason));
|
||||
|
||||
|
|
Loading…
Reference in a new issue