mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-16 10:45:15 +01:00
Add multiconnect beta check (#43)
This commit is contained in:
parent
6f5b1ac725
commit
c6e0c10b8d
@ -58,9 +58,18 @@ public class VRVersionProvider extends VersionProvider {
|
||||
Object mcApiInstance = mcApiClass.getMethod("instance").invoke(null);
|
||||
List<?> protocols = (List<?>) mcApiClass.getMethod("getSupportedProtocols").invoke(mcApiInstance);
|
||||
Method getValue = iProtocolClass.getMethod("getValue");
|
||||
Method isMulticonnectBeta;
|
||||
try {
|
||||
isMulticonnectBeta = iProtocolClass.getMethod("isMulticonnectBeta");
|
||||
} catch (NoSuchMethodException e) {
|
||||
isMulticonnectBeta = null;
|
||||
}
|
||||
multiconnectSupportedVersions = new TreeSet<>();
|
||||
for (Object protocol : protocols) {
|
||||
multiconnectSupportedVersions.add((Integer) getValue.invoke(protocol));
|
||||
// Do not use versions with beta multiconnect support, which may have stability issues
|
||||
if (isMulticonnectBeta == null || !(Boolean) isMulticonnectBeta.invoke(protocol)) {
|
||||
multiconnectSupportedVersions.add((Integer) getValue.invoke(protocol));
|
||||
}
|
||||
}
|
||||
ViaFabric.JLOGGER.info("ViaFabric will integrate with multiconnect");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user