alRex-U / alRex-U/AutoLook

Aim changing sound plays regardless of lock state

Open
#2 1 comment 0 reactions 1 assignee Claimed by @alRex-U View on GitHub
bug
Dominant language
Java
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

The sound for changing aim (BOOK_PAGE_TURN) plays if the mouse gets moved enough, even if there is no entity locked, being looked at or even visible. This got quite annoying once I noticed it, as it means that there are constant page turning sounds every time you look around.

I tested and reproduced it in a new Minecraft installation, with only this mod.

Steps to reproduce:
1. Start game and load into world
2. Move the mouse around
3. Hear page sound

Software Versions:
- OS: Ubuntu 18.04
- Minecraft: 1.16.5
- Forge: 36.2.33
- AutoLook: autolook-1.16.5-1.1.0.0-R from CurseForge

I had a quick look at the code, I think the problem is in [TickEventHandler.java](https://github.com/alRex-U/AutoLook/blob/main/src/main/java/com/alrexu/autolook/handler/TickEventHandler.java). The mouse shaking part gets evaluated every tick regardless of any lock state. If the mouse gets moved enough, it calls the handler.changeAimToward() with the corresponding direction, which immediately returns because lookedAim is null. But then the aimChanged variable gets set to true anyways, resulting in the sound being played.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.