Skip to content

Commit dc70f93

Browse files
refactor: simplifying the code of blockAtCursor (#3337)
1 parent 04ad6db commit dc70f93

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/plugins/ray_trace.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ module.exports = (bot) => {
1717
}
1818

1919
bot.blockAtCursor = (maxDistance = 256, matcher = null) => {
20-
const { position, height, pitch, yaw } = bot.entity
21-
22-
const eyePosition = position.offset(0, height, 0)
23-
const viewDirection = getViewDirection(pitch, yaw)
24-
25-
return bot.world.raycast(eyePosition, viewDirection, maxDistance, matcher)
20+
return bot.blockAtEntityCursor(bot.entity, maxDistance, matcher)
2621
}
2722

2823
bot.entityAtCursor = (maxDistance = 3.5) => {

0 commit comments

Comments
 (0)