mojira.dev

Mekal Covic

Assigned

No issues.

Reported

No issues.

Comments

Hi Fabian,

The buttons already play sound on onRelease. The lack of checks around this is the reason this issue exists.

 

I'm a minecraft modder, and I accidentally found the source of this bug while making a custom GUI.

The problem is, as Joey mentioned above, because minecraft is coded to play the click sound for sliders on mouse release (see: AbstractSliderButton.java, method onRelease). Because the GUI changes on the mouse press, not release, the GUI elements have changed by the time you are releasing the mouse, resulting in the repeat of the sound. This can be resolved by adding some checks around the playDownSound call to make sure you've actually been manipulating the slider.