aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-17 23:55:11 -0500
committermat <github@matdoes.dev>2022-06-17 23:55:11 -0500
commit614b21129804930159f041ce3f51202bc3e1c0b6 (patch)
tree9c78d1f1bb13de5ae91d2ca2092da28c1b8ae6ef /azalea-entity/src
parentf993e79a7e6acc7aadd1e6cf9462d7a3e2c3ac3e (diff)
downloadazalea-drasl-614b21129804930159f041ce3f51202bc3e1c0b6.tar.xz
EntityStorage
Diffstat (limited to 'azalea-entity/src')
-rw-r--r--azalea-entity/src/lib.rs13
1 files changed, 12 insertions, 1 deletions
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)]