aboutsummaryrefslogtreecommitdiff
path: root/azalea
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-12-10 00:08:08 -0600
committerGitHub <noreply@github.com>2023-12-10 00:08:08 -0600
commit348c71b97b2dfc45d7412ec33f6131e20592bb14 (patch)
tree2490f6fe8e4d8181a526b66e0397ceea96ec8961 /azalea
parentf15f0325c0a9d62f10ea22b891ab7134391b04fb (diff)
downloadazalea-drasl-348c71b97b2dfc45d7412ec33f6131e20592bb14.tar.xz
Climbing (#121)
* start implementing climbing * fix tests * fix bots running at lower tick rate
Diffstat (limited to 'azalea')
-rw-r--r--azalea/src/auto_tool.rs2
-rw-r--r--azalea/src/pathfinder/simulation.rs36
2 files changed, 20 insertions, 18 deletions
diff --git a/azalea/src/auto_tool.rs b/azalea/src/auto_tool.rs
index 55ec6924..2cf53085 100644
--- a/azalea/src/auto_tool.rs
+++ b/azalea/src/auto_tool.rs
@@ -43,6 +43,8 @@ pub fn best_tool_in_hotbar_for_block(block: BlockState, menu: &Menu) -> BestTool
dimensions: Default::default(),
bounding_box: Default::default(),
has_impulse: Default::default(),
+ horizontal_collision: Default::default(),
+ vertical_collision: Default::default(),
},
&FluidOnEyes::new(Fluid::Empty),
)
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,
}
}