Skip to content

Commit

Permalink
fixed jumping
Browse files Browse the repository at this point in the history
  • Loading branch information
GenerelSchwerz committed Sep 9, 2024
1 parent 42f4677 commit 5f0d2f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/autoJumper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export class JumpChecker extends BaseSimulator implements JumpCheckerOpts {

// if we have a horizontal collision, check to see if it is two-blocks high.
// if so, we cannot jump.




if (collided != null) {
const blocks = this.findAllTouchingBlocks(collided);
const startYFloor = Math.floor(this.bot.entity.position.y);
Expand Down Expand Up @@ -205,7 +209,7 @@ export class JumpChecker extends BaseSimulator implements JumpCheckerOpts {

if (this.minimizeFallDmg && tooMuchFallDmg && !state.isInWater) return true;

return state.isCollidedHorizontally && Math.floor(state.pos.y) >= Math.floor(this.bot.entity.position.y);
return state.isCollidedHorizontally && Math.floor(state.pos.y) <= Math.floor(this.bot.entity.position.y);
}

/**
Expand Down

0 comments on commit 5f0d2f2

Please sign in to comment.