aboutsummaryrefslogtreecommitdiff
path: root/azalea-registry/src/data.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-08-10 18:55:23 -0500
committerGitHub <noreply@github.com>2025-08-10 18:55:23 -0500
commit7120842f9d2c659a2f12d8922299c2a761bc5582 (patch)
tree0d7976ceec82d914e4c75f23adcdd5839f9960a4 /azalea-registry/src/data.rs
parent3b659833c1ad4cca89b4cd553193edcb6d223163 (diff)
downloadazalea-drasl-7120842f9d2c659a2f12d8922299c2a761bc5582.tar.xz
Send correct data component checksums (#234)
* start implementing data component crc32 hashes * start doing serde impls for checksums * make more components hashable * make all data components serializable * support recursive components * fix simdnbt dep * update changelog * clippy
Diffstat (limited to 'azalea-registry/src/data.rs')
-rw-r--r--azalea-registry/src/data.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/azalea-registry/src/data.rs b/azalea-registry/src/data.rs
index a9f797b6..c1c1efe5 100644
--- a/azalea-registry/src/data.rs
+++ b/azalea-registry/src/data.rs
@@ -40,6 +40,17 @@ macro_rules! data_registry {
Self { id }
}
}
+
+ #[cfg(feature = "serde")]
+ impl serde::Serialize for $name {
+ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+ where
+ S: serde::Serializer,
+ {
+ // see ChecksumSerializer::serialize_newtype_variant
+ serializer.serialize_newtype_variant(concat!("minecraft:", $registry_name), self.id, "", &())
+ }
+ }
};
}