2626import com .lambda .interaction .request .rotation .RotationManager ;
2727import com .lambda .module .modules .player .PortalGui ;
2828import com .lambda .module .modules .render .ViewModel ;
29+ import com .mojang .authlib .GameProfile ;
2930import net .minecraft .client .MinecraftClient ;
3031import net .minecraft .client .gui .screen .Screen ;
3132import net .minecraft .client .input .Input ;
3233import net .minecraft .client .network .AbstractClientPlayerEntity ;
3334import net .minecraft .client .network .ClientPlayerEntity ;
35+ import net .minecraft .client .world .ClientWorld ;
3436import net .minecraft .entity .MovementType ;
3537import net .minecraft .util .Hand ;
38+ import net .minecraft .util .math .MathHelper ;
3639import net .minecraft .util .math .Vec3d ;
3740import org .spongepowered .asm .mixin .Final ;
3841import org .spongepowered .asm .mixin .Mixin ;
4649import java .util .Objects ;
4750
4851@ Mixin (value = ClientPlayerEntity .class , priority = Integer .MAX_VALUE )
49- public abstract class ClientPlayerEntityMixin extends EntityMixin {
52+ public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity {
5053
5154 @ Shadow
5255 private boolean autoJumpEnabled ;
5356
57+ public ClientPlayerEntityMixin (ClientWorld world , GameProfile profile ) {
58+ super (world , profile );
59+ }
60+
5461 @ Shadow
5562 protected abstract void autoJump (float dx , float dz );
5663
@@ -70,13 +77,14 @@ void onMove(MovementType movementType, Vec3d movement, CallbackInfo ci) {
7077 float prevZ = (float ) self .getZ ();
7178
7279 EventFlow .post (new MovementEvent .Player .Pre (movementType , movement ));
73- super .move (movementType , self . getVelocity () );
80+ super .move (movementType , movement );
7481 EventFlow .post (new MovementEvent .Player .Post (movementType , movement ));
7582
76- float currX = (float ) self .getX ();
77- float currZ = (float ) self .getZ ();
83+ float deltaX = (float ) self .getX () - prevX ;
84+ float deltaZ = (float ) self .getZ () - prevZ ;
7885
79- this .autoJump (currX - prevX , currZ - prevZ );
86+ this .autoJump (deltaX , deltaZ );
87+ this .distanceMoved = this .distanceMoved + MathHelper .hypot (deltaX , deltaZ ) * 0.6F ;
8088 }
8189
8290 @ Redirect (method = "tickMovement" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/input/Input;tick()V" ))
0 commit comments