Skip to content

Commit b81c94e

Browse files
CopilotEastArctica
andcommitted
Address code review feedback with improved documentation
Co-authored-by: EastArctica <[email protected]>
1 parent 5eb2308 commit b81c94e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/src/main/java/com/jsmacrosce/jsmacros/client/api/helper/world/entity/ClientPlayerEntityHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public ClientPlayerEntityHelper<T> lookAt(String direction) {
199199
* Wraps {@code targetAngle} into an equivalent angle that is
200200
* closest to {@code lastAngle}, preventing large packet deltas.
201201
*
202-
* @param lastAngle the angle last sent to the server
202+
* @param lastAngle the previous rotation value
203203
* @param targetAngle the desired logical angle
204204
* @return an angle value safe to send this tick
205205
*/
@@ -219,6 +219,7 @@ public ClientPlayerEntityHelper<T> lookAt(double yaw, double pitch) {
219219
base.yRotO = base.getYRot();
220220

221221
float safeYaw = safeWrapDegrees(base.yRotO, (float) yaw);
222+
// Pitch is wrapped relative to previous pitch, then clamped to valid range [-90, 90]
222223
float safePitch = Mth.clamp(safeWrapDegrees(base.xRotO, (float) pitch), -90.0F, 90.0F);
223224

224225
base.setXRot(safePitch);

0 commit comments

Comments
 (0)