Skip to content

Bug: compatibility with other clients (jump hook) #271

@cattyngmd

Description

@cattyngmd

What happened?

Lambda jump hook causes other clients to fail in some scenarios (like highjump not working)

@Inject(method = "jump", at = @At("HEAD"), cancellable = true)
void onJump(CallbackInfo ci) {
LivingEntity self = lambda$instance;
if (self != Lambda.getMc().player) return;
ci.cancel();
float height = this.getJumpVelocity();
MovementEvent.Jump event = EventFlow.post(new MovementEvent.Jump(height));
if (event.isCanceled()) return;
Vec3d vec3d = self.getVelocity();
self.setVelocity(vec3d.x, event.getHeight(), vec3d.z);
if (self.isSprinting()) {
Float yaw = RotationManager.getMovementYaw();
float f = ((yaw != null) ? yaw : self.getYaw()) * ((float) Math.PI / 180);
self.setVelocity(self.getVelocity().add(-MathHelper.sin(f) * 0.2f, 0.0, MathHelper.cos(f) * 0.2f));
}
self.velocityDirty = true;
}

What should have happened?

dont overwrite the jump method pls Thanks

Version

0.1.0+1.21.11

Log Output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReports or fixes new or existing bugstriageRequires labelling or review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions