Bug in player interaction bot peripheral #12

Closed
opened 2023-11-27 19:50:36 +00:00 by BlakeRain · 0 comments
Owner

The player action peripheral doesn't work when the bot is facing east. It seems that the line in TurtlePlayerCache is incorrectly multiplying by 0.5 when the direction is going down negative X rather than adding 0.5:

//                                                                       This should be + not * ----+
//                                                                                                  V
double x = (axis == Direction.Axis.X && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 : (0.5 * normal.getX() / 1.9);
double y = 0.5 + normal.getY() / 1.9;
double z = (axis == Direction.Axis.Z && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 : (0.5 + normal.getZ() / 1.9);
The player action peripheral doesn't work when the bot is facing east. It seems that the line in [`TurtlePlayerCache`](https://git.blakerain.com/bans-minecraft/utamacraft/src/branch/main/src/main/java/net/banutama/utamacraft/integrations/computercraft/turtles/TurtlePlayerCache.java#L45) is incorrectly multiplying by `0.5` when the direction is going down negative X rather than adding `0.5`: ```java // This should be + not * ----+ // V double x = (axis == Direction.Axis.X && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 : (0.5 * normal.getX() / 1.9); double y = 0.5 + normal.getY() / 1.9; double z = (axis == Direction.Axis.Z && axis_dir == Direction.AxisDirection.NEGATIVE) ? -0.5 : (0.5 + normal.getZ() / 1.9); ```
BlakeRain added the
Kind/Bug
Priority
High
labels 2023-11-27 19:50:36 +00:00
BlakeRain added this to the Mod Development project 2023-11-27 19:50:36 +00:00
BlakeRain added this to the v0.1.1 milestone 2023-11-27 19:51:43 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bans-minecraft/utamacraft#12
No description provided.