Skip to content

Commit

Permalink
refactor: simplifying the code of blockAtCursor (#3337)
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowRunescape authored Apr 28, 2024
1 parent 04ad6db commit dc70f93
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/plugins/ray_trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ module.exports = (bot) => {
}

bot.blockAtCursor = (maxDistance = 256, matcher = null) => {
const { position, height, pitch, yaw } = bot.entity

const eyePosition = position.offset(0, height, 0)
const viewDirection = getViewDirection(pitch, yaw)

return bot.world.raycast(eyePosition, viewDirection, maxDistance, matcher)
return bot.blockAtEntityCursor(bot.entity, maxDistance, matcher)
}

bot.entityAtCursor = (maxDistance = 3.5) => {
Expand Down

0 comments on commit dc70f93

Please sign in to comment.