mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 09:26:11 -04:00
replace string concentration with placeholders (where useful)
This commit is contained in:
parent
42b0bbf16b
commit
09f22e64a2
@ -86,6 +86,9 @@ public class MainWindow implements Initializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void selectAccount() {
|
public static void selectAccount() {
|
||||||
|
if (menuAccount2 == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Minosoft.getSelectedAccount() != null) {
|
if (Minosoft.getSelectedAccount() != null) {
|
||||||
menuAccount2.setText(LocaleManager.translate(Strings.MAIN_WINDOW_MENU_SERVERS_ACCOUNTS_SELECTED, Minosoft.getSelectedAccount().getPlayerName()));
|
menuAccount2.setText(LocaleManager.translate(Strings.MAIN_WINDOW_MENU_SERVERS_ACCOUNTS_SELECTED, Minosoft.getSelectedAccount().getPlayerName()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -93,7 +93,7 @@ public class Server {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getName() + " (" + getAddress() + ")";
|
return String.format("%s (%s)", getName(), getAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -100,7 +100,7 @@ public class PacketDecoder extends ByteToMessageDecoder {
|
|||||||
if (packet == null) {
|
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()));
|
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();
|
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();
|
Class<? extends ClientboundPacket> clazz = packet.getClazz();
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ public class SocketNetwork implements Network {
|
|||||||
if (packet == null) {
|
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()));
|
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();
|
disconnect();
|
||||||
lastException = new RuntimeException("Invalid packet 0x" + inPacketBuffer.getCommand());
|
lastException = new RuntimeException(String.format("Invalid packet 0x%x", inPacketBuffer.getCommand()));
|
||||||
throw lastException;
|
throw lastException;
|
||||||
}
|
}
|
||||||
Class<? extends ClientboundPacket> clazz = packet.getClazz();
|
Class<? extends ClientboundPacket> clazz = packet.getClazz();
|
||||||
|
@ -44,6 +44,6 @@ public class StringTag extends NBTTag {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "\"" + value + "\"";
|
return String.format("\"%s\"", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user