diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-12-10 00:08:08 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-10 00:08:08 -0600 |
| commit | 348c71b97b2dfc45d7412ec33f6131e20592bb14 (patch) | |
| tree | 2490f6fe8e4d8181a526b66e0397ceea96ec8961 /azalea/src/pathfinder/simulation.rs | |
| parent | f15f0325c0a9d62f10ea22b891ab7134391b04fb (diff) | |
| download | azalea-drasl-348c71b97b2dfc45d7412ec33f6131e20592bb14.tar.xz | |
Climbing (#121)
* start implementing climbing
* fix tests
* fix bots running at lower tick rate
Diffstat (limited to 'azalea/src/pathfinder/simulation.rs')
| -rw-r--r-- | azalea/src/pathfinder/simulation.rs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index 88261b7f..b41d895a 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -7,13 +7,13 @@ use azalea_client::{ }; use azalea_core::{position::Vec3, resource_location::ResourceLocation, tick::GameTick}; use azalea_entity::{ - attributes::AttributeInstance, metadata::Sprinting, Attributes, EntityDimensions, Physics, - Position, + attributes::AttributeInstance, Attributes, EntityDimensions, Physics, Position, }; -use azalea_world::{ChunkStorage, Instance, InstanceContainer, InstanceName, MinecraftEntityId}; +use azalea_world::{ChunkStorage, Instance, InstanceContainer, MinecraftEntityId}; use bevy_app::App; use bevy_ecs::prelude::*; use parking_lot::RwLock; +use uuid::Uuid; #[derive(Bundle, Clone)] pub struct SimulatedPlayerBundle { @@ -82,24 +82,24 @@ impl Simulation { schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::SingleThreaded); }); - let entity = app - .world - .spawn(( - MinecraftEntityId(0), - InstanceName(instance_name), - azalea_entity::LocalEntity, - azalea_entity::Jumping::default(), - azalea_entity::LookDirection::default(), - Sprinting(true), - azalea_entity::metadata::Player, - azalea_entity::EyeHeight::new(player.physics.dimensions.height * 0.85), - player, - )) - .id(); + let mut entity = app.world.spawn(( + MinecraftEntityId(0), + azalea_entity::LocalEntity, + azalea_entity::metadata::PlayerMetadataBundle::default(), + azalea_entity::EntityBundle::new( + Uuid::nil(), + *player.position, + azalea_registry::EntityKind::Player, + instance_name, + ), + )); + entity.insert(player); + + let entity_id = entity.id(); Self { app, - entity, + entity: entity_id, _instance: instance, } } |
