mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-01-02 22:07:49 +01:00
Add magical unknown protocol version, so that if it's not registered it doesn't NPE.
This commit is contained in:
parent
0f55402171
commit
8e64fb8c21
@ -37,7 +37,11 @@ public class ProtocolVersion {
|
||||
}
|
||||
|
||||
public static ProtocolVersion getProtocol(int id) {
|
||||
return versions.get(id);
|
||||
if (versions.containsKey(id)) {
|
||||
return versions.get(id);
|
||||
} else {
|
||||
return new ProtocolVersion(id, "Unknown (" + id + ")");
|
||||
}
|
||||
}
|
||||
|
||||
public static List<ProtocolVersion> getProtocols() {
|
||||
|
Loading…
Reference in New Issue
Block a user