replace string concentration with placeholders (where useful)

This commit is contained in:
Bixilon 2020-10-30 14:23:57 +01:00
parent 42b0bbf16b
commit 09f22e64a2
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
5 changed files with 7 additions and 4 deletions

View File

@ -86,6 +86,9 @@ public class MainWindow implements Initializable {
}
public static void selectAccount() {
if (menuAccount2 == null) {
return;
}
if (Minosoft.getSelectedAccount() != null) {
menuAccount2.setText(LocaleManager.translate(Strings.MAIN_WINDOW_MENU_SERVERS_ACCOUNTS_SELECTED, Minosoft.getSelectedAccount().getPlayerName()));
} else {

View File

@ -93,7 +93,7 @@ public class Server {
@Override
public String toString() {
return getName() + " (" + getAddress() + ")";
return String.format("%s (%s)", getName(), getAddress());
}
public String getName() {

View File

@ -100,7 +100,7 @@ public class PacketDecoder extends ByteToMessageDecoder {
if (packet == null) {
Log.fatal(String.format("Packet mapping does not contain a packet with id 0x%x. The server sends bullshit or your versions.json broken!", inPacketBuffer.getCommand()));
nettyNetwork.disconnect();
throw new RuntimeException("Invalid packet 0x%x" + inPacketBuffer.getCommand());
throw new RuntimeException(String.format("Invalid packet 0x%x", inPacketBuffer.getCommand()));
}
Class<? extends ClientboundPacket> clazz = packet.getClazz();

View File

@ -195,7 +195,7 @@ public class SocketNetwork implements Network {
if (packet == null) {
Log.fatal(String.format("Packet mapping does not contain a packet with id 0x%x. The server sends bullshit or your versions.json broken!", inPacketBuffer.getCommand()));
disconnect();
lastException = new RuntimeException("Invalid packet 0x" + inPacketBuffer.getCommand());
lastException = new RuntimeException(String.format("Invalid packet 0x%x", inPacketBuffer.getCommand()));
throw lastException;
}
Class<? extends ClientboundPacket> clazz = packet.getClazz();

View File

@ -44,6 +44,6 @@ public class StringTag extends NBTTag {
@Override
public String toString() {
return "\"" + value + "\"";
return String.format("\"%s\"", value);
}
}