From 614b21129804930159f041ce3f51202bc3e1c0b6 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 17 Jun 2022 23:55:11 -0500 Subject: EntityStorage --- azalea-entity/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'azalea-entity/src') diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index 506f5780..0e0178b5 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -4,7 +4,18 @@ use azalea_core::EntityPos; pub struct Entity { /// The incrementing numerical id of the entity. pub id: u32, - pub pos: EntityPos, + pos: EntityPos, +} + +impl Entity { + pub fn pos(&self) -> &EntityPos { + &self.pos + } + + pub fn set_pos(&mut self, pos: EntityPos) { + // TODO: check if it moved to another chunk + self.pos = pos; + } } // #[cfg(test)] -- cgit v1.2.3