wiwiho
1
I tried to modify the pitch of a note block.
The pitch that I offer and the final pitch are different.
For example:
Note note = ...;
NoteData data = note.getNoteData();
data.set(data.note().set(NotePitches.A2));
note.offer(data);
System.out.println(note.getNoteData().note().get());
It should print “SpongeNotePitch{id=A2, name=A2}”, but it prints “SpongeNotePitch{id=G0, name=G0}”.
Do I make any mistake?
Edit:
I think this is a bug of Sponge, and I submitted an issue on Github.
What happens if you just say note.offer(Keys.NOTE_PITCH, NotePitches.A2)
?
wiwiho
3
It makes the same result.
And what platform/version is this on?
wiwiho
5
SpongeVanilla 1.12.2-7.1.2