diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-11-06 14:05:01 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-06 14:05:01 -0600 |
| commit | d112856ff6353592a50658b0ddd316f54dd97b87 (patch) | |
| tree | 6c408ecab96012e3bffaf15843fad5b9b6817796 /azalea-world/src/entity_storage.rs | |
| parent | 9bc517511663193f3166320db4cb5ca02701b039 (diff) | |
| download | azalea-drasl-d112856ff6353592a50658b0ddd316f54dd97b87.tar.xz | |
Entity metadata (#37)
* add example generated metadata.rs
* metadata.rs codegen
* add the files
* add comment to top of metadata.rs
* avoid clone
* metadata
* defaults
* defaults
* fix metadata readers and writers
* fix bad bitmasks and ignore some clippy warnings in generated code
* add set_index function to entity metadatas
* applying metadata
Diffstat (limited to 'azalea-world/src/entity_storage.rs')
| -rw-r--r-- | azalea-world/src/entity_storage.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/azalea-world/src/entity_storage.rs b/azalea-world/src/entity_storage.rs index 4dd3ec12..02d7d55a 100644 --- a/azalea-world/src/entity_storage.rs +++ b/azalea-world/src/entity_storage.rs @@ -151,6 +151,8 @@ impl Default for EntityStorage { #[cfg(test)] mod tests { + use crate::entity::{metadata, EntityMetadata}; + use super::*; use azalea_core::Vec3; @@ -160,7 +162,14 @@ mod tests { assert!(storage.get_by_id(0).is_none()); let uuid = Uuid::from_u128(100); - storage.insert(0, EntityData::new(uuid, Vec3::default())); + storage.insert( + 0, + EntityData::new( + uuid, + Vec3::default(), + EntityMetadata::Player(metadata::Player::default()), + ), + ); assert_eq!(storage.get_by_id(0).unwrap().uuid, uuid); storage.remove_by_id(0); |
