Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 16:40:10 +01:00
Sort ProtocolVersions version list, fix base protocol registration
Dieser Commit ist enthalten in:
Ursprung
302716054d
Commit
c124c1c809
@ -108,6 +108,7 @@ public class ProtocolVersion implements Comparable<ProtocolVersion> {
|
||||
*/
|
||||
public static void register(ProtocolVersion protocolVersion) {
|
||||
VERSION_LIST.add(protocolVersion);
|
||||
VERSION_LIST.sort(ProtocolVersion::compareTo);
|
||||
|
||||
final Int2ObjectMap<ProtocolVersion> versions = VERSIONS.computeIfAbsent(protocolVersion.versionType, $ -> new Int2ObjectOpenHashMap<>());
|
||||
versions.put(protocolVersion.version, protocolVersion);
|
||||
@ -403,7 +404,6 @@ public class ProtocolVersion implements Comparable<ProtocolVersion> {
|
||||
return this.compareTo(other) <= 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this protocol version is between the given protocol versions, inclusive.
|
||||
*
|
||||
|
@ -135,6 +135,7 @@ public class ProtocolManagerImpl implements ProtocolManager {
|
||||
public void registerProtocols() {
|
||||
// Base Protocol
|
||||
BASE_PROTOCOL.initialize();
|
||||
BASE_PROTOCOL.register(Via.getManager().getProviders());
|
||||
registerBaseProtocol(new BaseProtocol1_7(), Range.closedOpen(ProtocolVersion.v1_7_1, ProtocolVersion.v1_16));
|
||||
registerBaseProtocol(new BaseProtocol1_16(), Range.atLeast(ProtocolVersion.v1_16));
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren