mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-04 22:59:07 +02:00
world/text_value: add support for new NBT text serialization
Starting with DataVersion 4290, text is stored as NBT instead of JSON. The structure remains the same.
This commit is contained in:
parent
ba6e4bae7f
commit
5f84ec8ed2
4 changed files with 35 additions and 11 deletions
|
@ -58,6 +58,8 @@ pub struct Chunk<'a> {
|
|||
inner: ChunkInner<'a>,
|
||||
/// Unprocessed block entities
|
||||
block_entities: &'a Vec<de::BlockEntity>,
|
||||
/// Chunk data version
|
||||
data_version: u32,
|
||||
}
|
||||
|
||||
impl<'a> Chunk<'a> {
|
||||
|
@ -87,6 +89,7 @@ impl<'a> Chunk<'a> {
|
|||
Chunk {
|
||||
inner,
|
||||
block_entities,
|
||||
data_version,
|
||||
},
|
||||
has_unknown,
|
||||
))
|
||||
|
@ -292,7 +295,11 @@ impl<'a> Chunk<'a> {
|
|||
.iter()
|
||||
.map(|block_entity| {
|
||||
let block_type = self.block_type_at_block_entity(block_entity)?;
|
||||
Ok(BlockEntity::new(block_entity, block_type))
|
||||
Ok(BlockEntity::new(
|
||||
block_entity,
|
||||
block_type,
|
||||
self.data_version,
|
||||
))
|
||||
})
|
||||
.collect::<Result<_>>()?;
|
||||
Ok(entities.into_iter().flatten().collect())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue