mirror of
https://github.com/ViaVersion/ViaLoader.git
synced 2024-11-15 10:45:28 +01:00
Added VersionEnum#fromProtocolName
This commit is contained in:
parent
50c7f623a6
commit
9e90d1f098
@ -220,6 +220,12 @@ public enum VersionEnum {
|
||||
return fromProtocolVersion(ProtocolVersion.getProtocol(protocolId));
|
||||
}
|
||||
|
||||
public static VersionEnum fromProtocolName(final String protocolName) {
|
||||
final ProtocolVersion protocolVersion = ProtocolVersion.getClosest(protocolName);
|
||||
if (protocolVersion == null) return UNKNOWN;
|
||||
return fromProtocolVersion(protocolVersion);
|
||||
}
|
||||
|
||||
public static VersionEnum fromUserConnection(final UserConnection userConnection) {
|
||||
return fromUserConnection(userConnection, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user