mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
Enable serde feature in sub-crates (#202)
Add serde derive to MinecraftEntityId
This commit is contained in:
parent
022771b71b
commit
c285fadd34
4 changed files with 12 additions and 6 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -547,6 +547,7 @@ dependencies = [
|
|||
"nohash-hasher",
|
||||
"parking_lot",
|
||||
"rustc-hash 2.1.1",
|
||||
"serde",
|
||||
"simdnbt",
|
||||
"thiserror 2.0.11",
|
||||
"tracing",
|
||||
|
|
|
@ -13,19 +13,21 @@ criterion = "0.5.1"
|
|||
[dependencies]
|
||||
azalea-block = { path = "../azalea-block", default-features = false, version = "0.11.0" }
|
||||
azalea-buf = { path = "../azalea-buf", version = "0.11.0" }
|
||||
azalea-core = { path = "../azalea-core", version = "0.11.0", features = [
|
||||
"bevy_ecs",
|
||||
] }
|
||||
azalea-core = { path = "../azalea-core", version = "0.11.0", features = ["bevy_ecs"] }
|
||||
azalea-registry = { path = "../azalea-registry", version = "0.11.0" }
|
||||
bevy_ecs.workspace = true
|
||||
derive_more = { workspace = true, features = ["deref", "deref_mut"] }
|
||||
nohash-hasher.workspace = true
|
||||
parking_lot.workspace = true
|
||||
rustc-hash.workspace = true
|
||||
serde = { workspace = true, optional = true }
|
||||
simdnbt.workspace = true
|
||||
thiserror.workspace = true
|
||||
tracing.workspace = true
|
||||
|
||||
[features]
|
||||
serde = ["dep:serde"]
|
||||
|
||||
[[bench]]
|
||||
name = "chunks"
|
||||
harness = false
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -8,7 +8,7 @@ repository.workspace = true
|
|||
|
||||
[package.metadata.release]
|
||||
pre-release-replacements = [
|
||||
{ file = "README.md", search = "`azalea = \"[a-z0-9\\.-]+\"`", replace = "`azalea = \"{{version}}\"`" },
|
||||
{ file = "README.md", search = "`azalea = \"[a-z0-9\\.-]+\"`", replace = "`azalea = \"{{version}}\"`" },
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
|
@ -56,7 +56,7 @@ anyhow.workspace = true
|
|||
default = ["log", "serde"]
|
||||
# enables bevy_log::LogPlugin by default
|
||||
log = ["azalea-client/log"]
|
||||
serde = ["dep:serde"]
|
||||
serde = ["dep:serde", "azalea-core/serde", "azalea-registry/serde", "azalea-world/serde"]
|
||||
|
||||
[[bench]]
|
||||
name = "pathfinder"
|
||||
|
|
Loading…
Add table
Reference in a new issue