3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Add magical unknown protocol version, so that if it's not registered it doesn't NPE.

Dieser Commit ist enthalten in:
Myles 2016-04-23 20:39:16 +01:00
Ursprung 0f55402171
Commit 8e64fb8c21

Datei anzeigen

@ -37,7 +37,11 @@ public class ProtocolVersion {
} }
public static ProtocolVersion getProtocol(int id) { public static ProtocolVersion getProtocol(int id) {
if (versions.containsKey(id)) {
return versions.get(id); return versions.get(id);
} else {
return new ProtocolVersion(id, "Unknown (" + id + ")");
}
} }
public static List<ProtocolVersion> getProtocols() { public static List<ProtocolVersion> getProtocols() {