Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.21.4] Note block changes note by 2 half tones per interaction #1938

Closed
RedstoneDubstep opened this issue Feb 4, 2025 · 2 comments · Fixed by #1939
Closed

[1.21.4] Note block changes note by 2 half tones per interaction #1938

RedstoneDubstep opened this issue Feb 4, 2025 · 2 comments · Fixed by #1939
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

Comments

@RedstoneDubstep
Copy link
Contributor

Minecraft Version: 1.21.4

NeoForge Version: 21.4.80-beta

Logs: Irrelevant

Steps to Reproduce:

  1. Place down a note block (preferably on a grass block so the note pitch is more audible)
  2. Rightclick the note block
    -> 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:

  • In 1.21, the call to CommonHooks#onNoteChange correctly accepts the note block state from the original state as the old parameter, and the cycled note state (so note + 1) as the _new parameter. Cycling is done just once within the CommonHooks#onNoteChange call.
  • In 1.21.4 (and likely also 1.21.2/3), before the call to CommonHooks#onNoteChange, the state is already cycled once and the new, cycled state (with note + 1) set to the state variable. Like before, CommonHooks#onNoteChange is called, with the "old" state (note + 1) as the old param and the "new" state (cycled again within the call, so now note + 2) to the new_ param. Therefore, cycling is done a total of 2 times within NoteBlock#useWithoutItem, which is erroneous.
@RedstoneDubstep RedstoneDubstep added the triage Needs triaging and confirmation label Feb 4, 2025
@sciwhiz12 sciwhiz12 added bug A bug or error regression Worked previously but doesn't anymore 1.21.3 Targeted at Minecraft 1.21.3 1.21.4 Targeted at Minecraft 1.21.4 and removed triage Needs triaging and confirmation labels Feb 4, 2025
@sciwhiz12
Copy link
Member

Confirmed on 21.4.80-beta and 21.3.60. Fix should be as simple as fixing the misaligned patch, by reapplying the removal of the original cycle call.

@neoforged-releases
Copy link

🚀 This issue has been resolved in NeoForge version 21.4.81-beta, as part of #1939.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants