mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
move az_world::entity_info to az_world::entities::info
This commit is contained in:
parent
d51b2a29b2
commit
aa886c101b
12 changed files with 29 additions and 25 deletions
|
@ -42,7 +42,7 @@ use azalea_protocol::{
|
|||
},
|
||||
resolver, ServerAddress,
|
||||
};
|
||||
use azalea_world::{entity::WorldName, EntityPlugin, Local, PartialWorld, World, WorldContainer};
|
||||
use azalea_world::{entity::{WorldName, EntityPlugin, Local}, PartialWorld, World, WorldContainer};
|
||||
use log::{debug, error};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use std::{collections::HashMap, fmt::Debug, io, net::SocketAddr, sync::Arc};
|
||||
|
|
|
@ -28,7 +28,7 @@ use crate::{
|
|||
/// You can also use the [`Local`] marker component for queries if you're only
|
||||
/// checking for a local player and don't need the contents of this component.
|
||||
///
|
||||
/// [`Local`]: azalea_world::Local
|
||||
/// [`Local`]: azalea_world::entity::Local
|
||||
/// [`Client`]: crate::Client
|
||||
#[derive(Component)]
|
||||
pub struct LocalPlayer {
|
||||
|
|
|
@ -28,7 +28,8 @@ use azalea_world::{
|
|||
set_rotation, Dead, EntityBundle, EntityKind, LastSentPosition, MinecraftEntityId, Physics,
|
||||
PlayerBundle, Position, WorldName,
|
||||
},
|
||||
LoadedBy, PartialWorld, RelativeEntityUpdate, WorldContainer,
|
||||
entity::{LoadedBy, RelativeEntityUpdate},
|
||||
PartialWorld, WorldContainer,
|
||||
};
|
||||
use log::{debug, error, trace, warn};
|
||||
use parking_lot::Mutex;
|
||||
|
|
|
@ -5,7 +5,7 @@ use azalea_ecs::{
|
|||
event::EventReader,
|
||||
system::{Commands, Res},
|
||||
};
|
||||
use azalea_world::EntityInfos;
|
||||
use azalea_world::entity::EntityInfos;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{packet_handling::AddPlayerEvent, GameProfileComponent};
|
||||
|
|
|
@ -16,9 +16,10 @@ use azalea_ecs::{
|
|||
};
|
||||
use azalea_world::{
|
||||
entity::{
|
||||
metadata::Sprinting, move_relative, Attributes, Jumping, Physics, Position, WorldName,
|
||||
metadata::Sprinting, move_relative, Attributes, Jumping, Local, Physics, Position,
|
||||
WorldName,
|
||||
},
|
||||
Local, World, WorldContainer,
|
||||
World, WorldContainer,
|
||||
};
|
||||
use collision::{move_colliding, MoverType};
|
||||
|
||||
|
@ -310,8 +311,8 @@ mod tests {
|
|||
use azalea_core::{ChunkPos, ResourceLocation};
|
||||
use azalea_ecs::{app::App, TickPlugin};
|
||||
use azalea_world::{
|
||||
entity::{EntityBundle, MinecraftEntityId},
|
||||
Chunk, EntityPlugin, PartialWorld,
|
||||
entity::{EntityBundle, EntityPlugin, MinecraftEntityId},
|
||||
Chunk, PartialWorld,
|
||||
};
|
||||
use uuid::Uuid;
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -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::*;
|
||||
|
|
|
@ -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::*;
|
||||
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! mat's bot for testing new azalea features
|
||||
//! a bot for testing new azalea features
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
|
@ -9,10 +9,7 @@ use azalea_ecs::{
|
|||
system::{Commands, Query},
|
||||
AppTickExt,
|
||||
};
|
||||
use azalea_world::{
|
||||
entity::{metadata::Player, set_rotation, Jumping, Physics, Position},
|
||||
Local,
|
||||
};
|
||||
use azalea_world::entity::{metadata::Player, set_rotation, Jumping, Local, Physics, Position};
|
||||
use std::f64::consts::PI;
|
||||
|
||||
use crate::pathfinder::PathfinderPlugin;
|
||||
|
|
|
@ -17,7 +17,7 @@ use azalea_ecs::{
|
|||
AppTickExt,
|
||||
};
|
||||
use azalea_world::entity::metadata::Player;
|
||||
use azalea_world::Local;
|
||||
use azalea_world::entity::Local;
|
||||
use azalea_world::{
|
||||
entity::{Physics, Position, WorldName},
|
||||
WorldContainer,
|
||||
|
|
Loading…
Add table
Reference in a new issue