diff --git a/src/main/java/de/florianmichael/viafabricplus/fixes/ClientsideFixes.java b/src/main/java/de/florianmichael/viafabricplus/fixes/ClientsideFixes.java index 1cbdce3b..f558749a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/fixes/ClientsideFixes.java +++ b/src/main/java/de/florianmichael/viafabricplus/fixes/ClientsideFixes.java @@ -152,13 +152,11 @@ public class ClientsideFixes { * @return The server address with the replaced default port */ public static ServerAddress replaceDefaultPort(final ServerInfo info) { - ProtocolVersion targetVersion = ((IServerInfo) info).viaFabricPlus$forcedVersion(); - if (targetVersion == null) { - targetVersion = ProtocolTranslator.getTargetVersion(); - } + final boolean isBedrock = Objects.equals(((IServerInfo) info).viaFabricPlus$forcedVersion(), BedrockProtocolVersion.bedrockLatest); + // If the default port for this entry should be replaced, check if the address already contains a port // We can't just replace vanilla's default port because a bedrock server might be running on the same port - if (BedrockSettings.global().replaceDefaultPort.getValue() && targetVersion.equals(BedrockProtocolVersion.bedrockLatest) && !info.address.contains(":")) { + if (BedrockSettings.global().replaceDefaultPort.getValue() && isBedrock && !info.address.contains(":")) { return ServerAddress.parse(info.address + ":" + 19132); } else { return ServerAddress.parse(info.address);