1.13.2: add untested Forge protocol handshake support (#145)

Initial support for the new Forge 1.1+3 server list ping JSON mod parsing
This commit is contained in:
iceiix 2020-06-21 12:01:31 -07:00 committed by GitHub
parent 55ff26409a
commit 7279f4177e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -1204,6 +1204,23 @@ impl Conn {
}
}
}
// Forge 1.13+ TODO: update for 1.14+ and test
if let Some(forge_data) = val.get("forgeData") {
if let Some(mods) = forge_data.get("mods") {
if let Value::Array(items) = mods {
for item in items {
if let Value::Object(obj) = item {
let modid = obj.get("modId").unwrap().as_str().unwrap().to_string();
let modmarker = obj.get("modmarker").unwrap().as_str().unwrap().to_string();
let version = modmarker;
forge_mods.push(crate::protocol::forge::ForgeMod { modid, version });
}
}
}
}
}
Ok((Status {
version: StatusVersion {