MCPcopy Create free account
hub / github.com/cuberite/cuberite / LoadNoteFromNBT

Method LoadNoteFromNBT

src/WorldStorage/WSSAnvil.cpp:921–936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919
920
921void cWSSAnvil::LoadNoteFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx)
922{
923 ASSERT(a_NBT.GetType(a_TagIdx) == TAG_Compound);
924 int x, y, z;
925 if (!GetBlockEntityNBTPos(a_NBT, a_TagIdx, x, y, z))
926 {
927 return;
928 }
929 std::auto_ptr<cNoteEntity> Note(new cNoteEntity(x, y, z, m_World));
930 int note = a_NBT.FindChildByName(a_TagIdx, "note");
931 if (note >= 0)
932 {
933 Note->SetPitch(a_NBT.GetByte(note));
934 }
935 a_BlockEntities.push_back(Note.release());
936}
937
938
939

Callers

nothing calls this directly

Calls 5

GetByteMethod · 0.80
releaseMethod · 0.80
GetTypeMethod · 0.45
FindChildByNameMethod · 0.45
SetPitchMethod · 0.45

Tested by

no test coverage detected