Finder is off
Darthfett opened this issue · 3 comments
The find command causes the bot to often give the wrong location of the block (off by one usually).
It appears that block values are being rounded down, instead of rounding towards 0 (?). Negative Z and Negative X directions cause the block position to be off.
Consider the points (0.5, 0.5, 0.5) and (-0.5, -0.5, -0.5).
In mineflayer, the first one maps to the block at (0, 0, 0) and the second one maps to the block at (-1, -1, -1). This is expected behavior.
Ah, you are correct. I was thinking that it should always just cut off the float part of the number.
Regardless, the 'blocks away' part of the message WAS off, depending on your relative position to the block. (if you are standing right next to it, it either displays that you are 1 or 3 blocks away). The issue was the result of my forgetting to properly floor the positions.