From c285fadd34df2a43a5cfe1d3c02a3cc47bf69e9e Mon Sep 17 00:00:00 2001 From: Shayne Hartford Date: Mon, 17 Feb 2025 18:28:37 -0500 Subject: Enable serde feature in sub-crates (#202) Add serde derive to MinecraftEntityId --- azalea-world/src/world.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'azalea-world/src') diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs index ffd60026..ae257696 100644 --- a/azalea-world/src/world.rs +++ b/azalea-world/src/world.rs @@ -14,6 +14,8 @@ use azalea_core::registry_holder::RegistryHolder; use bevy_ecs::{component::Component, entity::Entity}; use derive_more::{Deref, DerefMut}; use nohash_hasher::IntMap; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use crate::{ChunkStorage, PartialChunkStorage}; @@ -57,7 +59,8 @@ impl PartialInstance { /// `#[var]` attribute. /// /// [`Entity`]: bevy_ecs::entity::Entity -#[derive(Component, Copy, Clone, Debug, PartialEq, Eq, Deref, DerefMut)] +#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Deref, DerefMut)] +#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] pub struct MinecraftEntityId(pub i32); impl Hash for MinecraftEntityId { -- cgit v1.2.3