mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-01-24 16:31:28 +01:00
Don't add ProtocolVersion#unknown into ProtocolVersion#VERSION_LIST (#3697)
This commit is contained in:
parent
35ceee1a47
commit
08d8ccf6ca
@ -108,8 +108,10 @@ public class ProtocolVersion implements Comparable<ProtocolVersion> {
|
|||||||
* @param protocolVersion protocol version to register
|
* @param protocolVersion protocol version to register
|
||||||
*/
|
*/
|
||||||
public static void register(ProtocolVersion protocolVersion) {
|
public static void register(ProtocolVersion protocolVersion) {
|
||||||
|
if (protocolVersion != unknown) {
|
||||||
VERSION_LIST.add(protocolVersion);
|
VERSION_LIST.add(protocolVersion);
|
||||||
VERSION_LIST.sort(ProtocolVersion::compareTo);
|
VERSION_LIST.sort(ProtocolVersion::compareTo);
|
||||||
|
}
|
||||||
|
|
||||||
final Int2ObjectMap<ProtocolVersion> versions = VERSIONS.computeIfAbsent(protocolVersion.versionType, $ -> new Int2ObjectOpenHashMap<>());
|
final Int2ObjectMap<ProtocolVersion> versions = VERSIONS.computeIfAbsent(protocolVersion.versionType, $ -> new Int2ObjectOpenHashMap<>());
|
||||||
versions.put(protocolVersion.version, protocolVersion);
|
versions.put(protocolVersion.version, protocolVersion);
|
||||||
|
Loading…
Reference in New Issue
Block a user