Refactor NBT parsing logic and correct block data handling in read_blocks. Match schema changes and improve error handling across version loaders.

This commit is contained in:
2026-05-12 09:55:45 +02:00
parent 2a584e878f
commit b2f6e23fc1
2 changed files with 56 additions and 25 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ pub async unsafe fn get_connection() {
pub async fn load_all_schematics(filter: SchematicFilter) -> Vec<SchematicNode> {
unsafe { get_connection().await; }
let mut schematics = Vec::new();
let rows = unsafe { &CONN }.lock().unwrap().as_mut().unwrap().fetch_all(format!("SELECT SN.NodeId, SN.NodeName FROM NodeData ND INNER JOIN SchematicNode SN ON SN.NodeId = ND.NodeId WHERE NodeFormat = true {}", filter.build()).as_str()).await.expect("Failed to fetch schematics");
let rows = unsafe { &CONN }.lock().unwrap().as_mut().unwrap().fetch_all(format!("SELECT SN.NodeId, SN.NodeName FROM NodeData ND INNER JOIN SchematicNode SN ON SN.NodeId = ND.NodeId WHERE NodeFormat >= 2 {}", filter.build()).as_str()).await.expect("Failed to fetch schematics");
for row in rows {
schematics.push(SchematicNode {
id: row.get(0),