From 0a0418f0db33ab37745e2fbf86ab2b1e2e98a182 Mon Sep 17 00:00:00 2001 From: MoePus <547007249@qq.com> Date: Wed, 4 Sep 2024 21:14:39 +0900 Subject: [PATCH] call tryCheckInsideBlocks in redirectSetVelocity fix #867, #688 --- .../mod/mixin/feature/entity_collision/MixinEntity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/src/main/java/org/valkyrienskies/mod/mixin/feature/entity_collision/MixinEntity.java b/common/src/main/java/org/valkyrienskies/mod/mixin/feature/entity_collision/MixinEntity.java index d862f68d3..f41afc4dd 100644 --- a/common/src/main/java/org/valkyrienskies/mod/mixin/feature/entity_collision/MixinEntity.java +++ b/common/src/main/java/org/valkyrienskies/mod/mixin/feature/entity_collision/MixinEntity.java @@ -116,6 +116,8 @@ private void redirectSetVelocity(final MoverType moverType, final Vec3 movement, - collisionResponseHorizontalNormal.z() * parallelHorizontalVelocityComponent ); } + // The rest of the move function (including tryCheckInsideBlocks) is skipped, so calling it here + tryCheckInsideBlocks(); // Cancel the original invocation of Entity.setVelocity(DDD)V to remove vanilla behavior callbackInfo.cancel(); } @@ -224,6 +226,9 @@ private void preSpawnSprintParticle(final CallbackInfo ci) { @Shadow public abstract void setDeltaMovement(double x, double y, double z); + @Shadow + protected abstract void tryCheckInsideBlocks(); + @Shadow protected abstract Vec3 collide(Vec3 vec3d);