From 2d197e147e4ede9b2b38692a88f620e78feba437 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Sat, 5 Sep 2020 17:07:01 +0200 Subject: Use pitch lookup in noteblock block entity (#4826) - Removed the calculation in the noteblock block entity I did the calculation in python if anyone is interested where the numbers are from Co-authored-by: 12xx12 <12xx12100@gmail.com> --- src/WorldStorage/NBTChunkSerializer.cpp | 2 +- src/WorldStorage/WSSAnvil.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/WorldStorage') diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 51ca81663..419115ea0 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -532,7 +532,7 @@ public: { mWriter.BeginCompound(""); AddBasicTileEntity(a_Note, "Music"); - mWriter.AddByte("note", static_cast(a_Note->GetPitch())); + mWriter.AddByte("note", static_cast(a_Note->GetNote())); mWriter.EndCompound(); } diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index ebeb198b1..a62971e7c 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1419,7 +1419,7 @@ OwnedBlockEntity cWSSAnvil::LoadNoteBlockFromNBT(const cParsedNBT & a_NBT, int a int note = a_NBT.FindChildByName(a_TagIdx, "note"); if (note >= 0) { - NoteBlock->SetPitch(static_cast(a_NBT.GetByte(note))); + NoteBlock->SetNote(static_cast(a_NBT.GetByte(note))); } return NoteBlock; } -- cgit v1.2.3