aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-01-19 15:05:44 +0600
committermat <git@matdoes.dev>2026-01-19 13:28:15 +0400
commit6f82263de58c6f33cca8cc36276b5e478801b352 (patch)
tree6230d62ce601efa2ae31f9fb363e8d756d787d4d /azalea-client/src/plugins
parent70bd9c94dd7ca68777a0ead5f9432812e535bee3 (diff)
downloadazalea-drasl-6f82263de58c6f33cca8cc36276b5e478801b352.tar.xz
minor physics optimizations
Diffstat (limited to 'azalea-client/src/plugins')
-rw-r--r--azalea-client/src/plugins/movement.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index 94b996a0..6e2da752 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -346,10 +346,10 @@ pub fn local_player_ai_step(
let new_crouching = !abilities.flying
&& !is_swimming
&& !is_passenger
- && can_player_fit_within_blocks_and_entities_when(&ctx, Pose::Crouching)
&& (last_sent_input.is_some_and(|i| i.0.shift)
|| !is_sleeping
- && !can_player_fit_within_blocks_and_entities_when(&ctx, Pose::Standing));
+ && !can_player_fit_within_blocks_and_entities_when(&ctx, Pose::Standing))
+ && can_player_fit_within_blocks_and_entities_when(&ctx, Pose::Crouching);
if **crouching != new_crouching {
**crouching = new_crouching;
}
@@ -650,15 +650,15 @@ struct CanPlayerFitCtx<'world, 'state, 'a, 'b> {
physics: &'a Physics,
}
fn can_player_fit_within_blocks_and_entities_when(ctx: &CanPlayerFitCtx, pose: Pose) -> bool {
- // return this.level().noCollision(this,
- // this.getDimensions(var1).makeBoundingBox(this.position()).deflate(1.0E-7));
no_collision(
ctx.world,
Some(ctx.entity),
ctx.aabb_query,
ctx.collidable_entity_query,
ctx.physics,
- &calculate_dimensions(EntityKind::Player, pose).make_bounding_box(*ctx.position),
+ &calculate_dimensions(EntityKind::Player, pose)
+ .make_bounding_box(*ctx.position)
+ .deflate_all(1.0e-7),
false,
)
}