alRex-U / alRex-U/AutoLook

Aim changing sound plays regardless of lock state

未關閉
#2 1 則留言 0 個 reaction 已指派 1 人 已被 @alRex-U 認領 在 GitHub 檢視
bug
主要語言
Java
星號
1
分支
3
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。