ClientVersion: Fixes default version trying to return the server version

This commit is contained in:
Christian Koop 2021-10-30 14:09:45 +02:00
parent 04bc2145a1
commit a23224dbe2
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -59,8 +59,8 @@ public class ClientVersion {
}
private static ServerVersion protocolToVersion(int version) {
// https://github.com/ViaVersion/ViaVersion/blob/master/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java
// https://github.com/ProtocolSupport/ProtocolSupport/blob/master/src/protocolsupport/api/ProtocolVersion.java
// https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite
// https://github.com/ViaVersion/ViaVersion/blob/master/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java
switch (version) {
case 4:
case 5:
@ -103,8 +103,10 @@ public class ClientVersion {
case 755:
case 756:
return ServerVersion.V1_17;
default:
return version > 756 ? ServerVersion.getServerVersion() : ServerVersion.UNKNOWN;
}
return version > 498 ? ServerVersion.getServerVersion() : ServerVersion.UNKNOWN;
}
/**