aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2023-02-07 20:30:47 +0000
committerUbuntu <github@matdoes.dev>2023-02-07 20:30:53 +0000
commitaa886c101b398f52372df6054c00f9387428cac6 (patch)
treed95dee23fe28637fc0ca1a5eb49943adc84afe2f /azalea-world/src
parentd51b2a29b2911e4be480727e56553fa27cfbfce0 (diff)
downloadazalea-drasl-aa886c101b398f52372df6054c00f9387428cac6.tar.xz
move az_world::entity_info to az_world::entities::info
Diffstat (limited to 'azalea-world/src')
-rw-r--r--azalea-world/src/entity/info.rs (renamed from azalea-world/src/entity_info.rs)9
-rw-r--r--azalea-world/src/entity/mod.rs7
-rw-r--r--azalea-world/src/lib.rs4
-rw-r--r--azalea-world/src/world.rs7
4 files changed, 16 insertions, 11 deletions
diff --git a/azalea-world/src/entity_info.rs b/azalea-world/src/entity/info.rs
index 428336f0..bf7e0051 100644
--- a/azalea-world/src/entity_info.rs
+++ b/azalea-world/src/entity/info.rs
@@ -1,3 +1,6 @@
+//! Implement things relating to entity datas, like an index of uuids to
+//! entities.
+
use crate::{
deduplicate_entities, deduplicate_local_entities,
entity::{
@@ -27,6 +30,8 @@ use std::{
};
use uuid::Uuid;
+use super::Local;
+
/// Plugin handling some basic entity functionality.
pub struct EntityPlugin;
impl Plugin for EntityPlugin {
@@ -263,10 +268,6 @@ pub fn add_updates_received(
}
}
-/// A marker component that signifies that this entity is "local" and shouldn't
-/// be updated by other clients.
-#[derive(Component)]
-pub struct Local;
/// The [`UpdatesReceived`] component should never be on [`Local`] entities.
/// This warns if an entity has both components.
diff --git a/azalea-world/src/entity/mod.rs b/azalea-world/src/entity/mod.rs
index 60a00bfd..0d0449ac 100644
--- a/azalea-world/src/entity/mod.rs
+++ b/azalea-world/src/entity/mod.rs
@@ -3,6 +3,7 @@
pub mod attributes;
mod data;
mod dimensions;
+mod info;
pub mod metadata;
use crate::ChunkStorage;
@@ -21,6 +22,7 @@ use azalea_ecs::{
pub use data::*;
use derive_more::{Deref, DerefMut};
pub use dimensions::{update_bounding_box, EntityDimensions};
+pub use info::{EntityInfos, EntityPlugin, LoadedBy, PartialEntityInfos, RelativeEntityUpdate};
use std::fmt::Debug;
use uuid::Uuid;
@@ -314,6 +316,11 @@ pub struct PlayerBundle {
pub metadata: metadata::PlayerMetadataBundle,
}
+/// A marker component that signifies that this entity is "local" and shouldn't
+/// be updated by other clients.
+#[derive(Component)]
+pub struct Local;
+
// #[cfg(test)]
// mod tests {
// use super::*;
diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs
index 88715f44..f0fd5387 100644
--- a/azalea-world/src/lib.rs
+++ b/azalea-world/src/lib.rs
@@ -7,7 +7,6 @@ mod bit_storage;
mod chunk_storage;
mod container;
pub mod entity;
-mod entity_info;
mod palette;
mod world;
@@ -16,9 +15,6 @@ use std::backtrace::Backtrace;
pub use bit_storage::BitStorage;
pub use chunk_storage::{Chunk, ChunkStorage, PartialChunkStorage};
pub use container::*;
-pub use entity_info::{
- EntityInfos, EntityPlugin, LoadedBy, Local, PartialEntityInfos, RelativeEntityUpdate,
-};
use thiserror::Error;
pub use world::*;
diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs
index 5ec2bbac..53a1f377 100644
--- a/azalea-world/src/world.rs
+++ b/azalea-world/src/world.rs
@@ -1,7 +1,8 @@
use crate::{
- entity::{EntityUuid, MinecraftEntityId, WorldName},
- entity_info::LoadedBy,
- ChunkStorage, EntityInfos, Local, PartialChunkStorage, PartialEntityInfos, WorldContainer,
+ entity::{
+ EntityInfos, EntityUuid, LoadedBy, Local, MinecraftEntityId, PartialEntityInfos, WorldName,
+ },
+ ChunkStorage, PartialChunkStorage, WorldContainer,
};
use azalea_core::ChunkPos;
use azalea_ecs::{