aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/lib.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-07-24 04:42:52 -0530
committermat <git@matdoes.dev>2025-07-24 04:42:52 -0530
commit302752860c7c10f02479727fe3d6d3b086177604 (patch)
tree5088f051ed9a2e816b17966513c6494e69626728 /azalea-entity/src/lib.rs
parent45f89b48e425262974a993adc0774dcbcad397fa (diff)
downloadazalea-drasl-302752860c7c10f02479727fe3d6d3b086177604.tar.xz
update movement code for 1.21.5 changes
fixes grim flags
Diffstat (limited to 'azalea-entity/src/lib.rs')
-rw-r--r--azalea-entity/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs
index 340b6f25..18e9e1a1 100644
--- a/azalea-entity/src/lib.rs
+++ b/azalea-entity/src/lib.rs
@@ -50,10 +50,10 @@ pub fn move_relative(
pub fn input_vector(direction: LookDirection, speed: f32, acceleration: Vec3) -> Vec3 {
let distance = acceleration.length_squared();
- if distance < 1.0E-7 {
+ if distance < 1.0e-7 {
return Vec3::ZERO;
}
- let acceleration = if distance > 1.0 {
+ let acceleration = if distance > 1. {
acceleration.normalize()
} else {
acceleration
@@ -492,6 +492,7 @@ pub fn default_attributes(_entity_kind: EntityKind) -> Attributes {
// entities have different defaults
Attributes {
speed: AttributeInstance::new(0.1),
+ sneaking_speed: AttributeInstance::new(0.3),
attack_speed: AttributeInstance::new(4.0),
water_movement_efficiency: AttributeInstance::new(0.0),
block_interaction_range: AttributeInstance::new(4.5),