Skip to content

Commit 7279f41

Browse files
authored
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
1 parent 55ff264 commit 7279f41

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

protocol/src/protocol/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,23 @@ impl Conn {
12041204
}
12051205
}
12061206
}
1207+
// Forge 1.13+ TODO: update for 1.14+ and test
1208+
if let Some(forge_data) = val.get("forgeData") {
1209+
if let Some(mods) = forge_data.get("mods") {
1210+
if let Value::Array(items) = mods {
1211+
for item in items {
1212+
if let Value::Object(obj) = item {
1213+
let modid = obj.get("modId").unwrap().as_str().unwrap().to_string();
1214+
let modmarker = obj.get("modmarker").unwrap().as_str().unwrap().to_string();
1215+
1216+
let version = modmarker;
1217+
1218+
forge_mods.push(crate::protocol::forge::ForgeMod { modid, version });
1219+
}
1220+
}
1221+
}
1222+
}
1223+
}
12071224

12081225
Ok((Status {
12091226
version: StatusVersion {

0 commit comments

Comments
 (0)