[1.21.4] Note block changes note by 2 half tones per interaction #1938
Labels
1.21.3
Targeted at Minecraft 1.21.3
1.21.4
Targeted at Minecraft 1.21.4
bug
A bug or error
regression
Worked previously but doesn't anymore
Minecraft Version: 1.21.4
NeoForge Version: 21.4.80-beta
Logs: Irrelevant
Steps to Reproduce:
-> Observe how the note has changed from a F# to a G# instead of a G (or, if you don't have perfect pitch, observe how the 'note' block state has changed from 0 to 2 instead of 1)
Description of issue:
Every time a player rightclicks a note block to change the note, the note increases by 2 instead of 1. This isn't too terrible since there's an uneven amount of notes, so after 24 it will roll over to 1 which makes uneven notes accessible, however it is a clear deviation from vanilla behaviour.
This issue probably arose from a misaligned patch during porting (specifically, commit e18c200) in
NoteBlock#useWithoutItem
:CommonHooks#onNoteChange
correctly accepts thenote
block state from the original state as theold
parameter, and the cycled note state (so note + 1) as the_new
parameter. Cycling is done just once within theCommonHooks#onNoteChange
call.CommonHooks#onNoteChange
, the state is already cycled once and the new, cycled state (with note + 1) set to thestate
variable. Like before,CommonHooks#onNoteChange
is called, with the "old" state (note + 1) as theold
param and the "new" state (cycled again within the call, so now note + 2) to thenew_
param. Therefore, cycling is done a total of 2 times withinNoteBlock#useWithoutItem
, which is erroneous.The text was updated successfully, but these errors were encountered: