diff options
| author | mat <git@matdoes.dev> | 2025-10-30 19:50:37 +0100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-10-30 19:50:37 +0100 |
| commit | 7d0c7553fd5a0210285a51a65c10f898f641a0cc (patch) | |
| tree | 2bfc5747c55622082761f7d6e3cabf86ed8ae2e4 /azalea-physics | |
| parent | 03a496fc7d952b1136cb717f2e8d1ccfb798ee64 (diff) | |
| download | azalea-drasl-7d0c7553fd5a0210285a51a65c10f898f641a0cc.tar.xz | |
Remove unnecessary MoveEntityError and MovePlayerError types and other cleanup
Diffstat (limited to 'azalea-physics')
| -rw-r--r-- | azalea-physics/src/collision/mod.rs | 16 | ||||
| -rw-r--r-- | azalea-physics/src/lib.rs | 2 | ||||
| -rw-r--r-- | azalea-physics/src/travel.rs | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs index 3702c8c1..10b607f2 100644 --- a/azalea-physics/src/collision/mod.rs +++ b/azalea-physics/src/collision/mod.rs @@ -18,7 +18,7 @@ use azalea_entity::{ Attributes, Jumping, LookDirection, OnClimbable, Physics, PlayerAbilities, Pose, Position, metadata::Sprinting, }; -use azalea_world::{ChunkStorage, Instance, MoveEntityError}; +use azalea_world::{ChunkStorage, Instance}; use bevy_ecs::{entity::Entity, world::Mut}; pub use blocks::BlockWithShape; pub use discrete_voxel_shape::*; @@ -130,7 +130,7 @@ pub struct MoveCtx<'world, 'state, 'a, 'b> { /// /// In Mojmap, this is `Entity.move`. #[allow(clippy::too_many_arguments)] -pub fn move_colliding(ctx: &mut MoveCtx, mut movement: Vec3) -> Result<(), MoveEntityError> { +pub fn move_colliding(ctx: &mut MoveCtx, mut movement: Vec3) { // TODO: do all these // if self.no_physics { @@ -225,8 +225,8 @@ pub fn move_colliding(ctx: &mut MoveCtx, mut movement: Vec3) -> Result<(), MoveE // this.tryCheckInsideBlocks(); // float var25 = this.getBlockSpeedFactor(); - // this.setDeltaMovement(this.getDeltaMovement().multiply((double)var25, 1.0D, - // (double)var25)); if (this.level.getBlockStatesIfLoaded(this. + // this.setDeltaMovement(this.getDeltaMovement().multiply((double)var25, + // 1.0D, (double)var25)); if (this.level.getBlockStatesIfLoaded(this. // getBoundingBox().deflate(1.0E-6D)).noneMatch((var0) -> { // return var0.is(BlockTags.FIRE) || var0.is(Blocks.LAVA); // })) { @@ -239,11 +239,9 @@ pub fn move_colliding(ctx: &mut MoveCtx, mut movement: Vec3) -> Result<(), MoveE // playEntityOnFireExtinguishedSound(); } // } - // if (this.isOnFire() && (this.isInPowderSnow || this.isInWaterRainOrBubble())) - // { this.setRemainingFireTicks(-this.getFireImmuneTicks()); - // } - - Ok(()) + // if (this.isOnFire() && (this.isInPowderSnow || + // this.isInWaterRainOrBubble())) { this.setRemainingFireTicks(-this. + // getFireImmuneTicks()); } } fn check_fall_damage( diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index ad4626fb..b993a7b5 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -408,7 +408,7 @@ fn handle_relative_friction_and_calculate_movement(ctx: &mut MoveCtx, block_fric ctx.pose, ); - move_colliding(ctx, ctx.physics.velocity).expect("Entity should exist"); + move_colliding(ctx, ctx.physics.velocity); // let delta_movement = entity.delta; // ladders // if ((entity.horizontalCollision || entity.jumping) && (entity.onClimbable() diff --git a/azalea-physics/src/travel.rs b/azalea-physics/src/travel.rs index e5391bba..0b980d5a 100644 --- a/azalea-physics/src/travel.rs +++ b/azalea-physics/src/travel.rs @@ -173,7 +173,7 @@ fn travel_in_fluid(ctx: &mut MoveCtx) { // } move_relative(ctx.physics, ctx.direction, speed, acceleration); - move_colliding(ctx, ctx.physics.velocity).expect("Entity should exist"); + move_colliding(ctx, ctx.physics.velocity); let mut new_velocity = ctx.physics.velocity; if ctx.physics.horizontal_collision && *ctx.on_climbable { @@ -187,7 +187,7 @@ fn travel_in_fluid(ctx: &mut MoveCtx) { get_fluid_falling_adjusted_movement(gravity, moving_down, new_velocity, ctx.sprinting); } else { move_relative(ctx.physics, ctx.direction, 0.02, acceleration); - move_colliding(ctx, ctx.physics.velocity).expect("Entity should exist"); + move_colliding(ctx, ctx.physics.velocity); if ctx.physics.lava_fluid_height <= fluid_jump_threshold() { ctx.physics.velocity.x *= 0.5; |
