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 摘要。