aboutsummaryrefslogtreecommitdiff
path: root/azalea-nbt/src/decode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-nbt/src/decode.rs')
-rwxr-xr-xazalea-nbt/src/decode.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/azalea-nbt/src/decode.rs b/azalea-nbt/src/decode.rs
index 5421e1c5..35392b15 100755
--- a/azalea-nbt/src/decode.rs
+++ b/azalea-nbt/src/decode.rs
@@ -170,8 +170,9 @@ fn read_compound(stream: &mut Cursor<&[u8]>) -> Result<NbtCompound, Error> {
}
let name = read_string(stream)?;
let tag = Nbt::read_known(stream, tag_id)?;
- map.insert(name, tag);
+ map.insert_unsorted(name, tag);
}
+ map.sort();
Ok(map)
}
@@ -265,7 +266,7 @@ impl Nbt {
let name = read_string(stream)?;
let tag = Nbt::read_known(stream, tag_id)?;
let mut map = NbtCompound::with_capacity(1);
- map.insert(name, tag);
+ map.insert_unsorted(name, tag);
Ok(Nbt::Compound(map))
}