Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@cattyngmd

Description

@cattyngmd
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReports or fixes new or existing bugsReports or fixes new or existing bugstriageRequires labelling or reviewRequires 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.