alRex-U / alRex-U/AutoLook

Aim changing sound plays regardless of lock state

Ouverte
#2 1 commentaire 0 réactions 1 personne assignée Réclamée par @alRex-U Voir sur GitHub
bug
Langage dominant
Java
Étoiles
1
Forks
3
Métriques de merge des PR
Aucune PR mergée en 30 j

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.