Fix block data key in read_blocks function

Updated the `read_blocks` function to retrieve `Data` instead of `BlockData` from the NBT structure. This resolves potential mismatches and ensures compatibility with the expected key in the NBT schema.
This commit is contained in:
2025-05-11 19:51:49 +02:00
parent 3f22799f7b
commit a64f24eb58

View File

@ -132,7 +132,7 @@ impl SpongeSchematic {
offset: read_offset(nbt.get_i32_vec("Offset").map_err(|e| e.to_string())?)?, offset: read_offset(nbt.get_i32_vec("Offset").map_err(|e| e.to_string())?)?,
palette_max: compute_palette_max(blocks.get_compound_tag("Palette").map_err(|e| e.to_string())?), palette_max: compute_palette_max(blocks.get_compound_tag("Palette").map_err(|e| e.to_string())?),
palette: read_palette(blocks.get_compound_tag("Palette").map_err(|e| e.to_string())?), palette: read_palette(blocks.get_compound_tag("Palette").map_err(|e| e.to_string())?),
block_data: read_blocks(blocks.get_i8_vec("BlockData").map_err(|e| e.to_string())?), block_data: read_blocks(blocks.get_i8_vec("Data").map_err(|e| e.to_string())?),
block_entities: read_tile_entities(blocks.get_compound_tag_vec("BlockEntities").unwrap_or_else(|_| vec![]))?, block_entities: read_tile_entities(blocks.get_compound_tag_vec("BlockEntities").unwrap_or_else(|_| vec![]))?,
entities: None, entities: None,
}) })