Closed AppliedEM closed 6 years ago
After looking at the code, the issue is in \src\main\java\com\austinv11\peripheralsplusplus\tiles\TileEntityPlayerSensor.java. The distance was being calculated incorrectly on line 89. I changed the line to
map.put(player.getDisplayName(), Math.sqrt(Math.pow(location.getX() - player.posX,2) + Math.pow(location.getY() - player.posY,2) + Math.pow(location.getZ() - player.posZ,2)));
And the sensor began working mostly correctly again.
This mod got taken over, please head to https://github.com/rolandoislas/PeripheralsPlusOne for any further questions.
Description
The player sensor's x reading is 1.3 blocks too high in the x direction, and roughly .3 blocks too high in the y direction. Could not get it to change its reading based on the z direction distance and I expect it is simply not reading any values based on that axis.
Steps to Reproduce
...
Expected behavior: A true cartesian floating point distance from the player to the center of the block
Actual behavior: The cartesian distance from the player's x.y plane, with significant error
Version affected: 1.3.6 forge 1.7.10
Additional Information
something to note is that my tests were conducted in a mystcraft dimension. Not sure if that would have any affect