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

Method SaveMapToNBT

src/WorldStorage/MapSerializer.cpp:101–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101void cMapSerializer::SaveMapToNBT(cFastNBTWriter & a_Writer)
102{
103 a_Writer.BeginCompound("data");
104
105 a_Writer.AddByte("scale", m_Map->GetScale());
106 a_Writer.AddByte("dimension", (int) m_Map->GetDimension());
107
108 a_Writer.AddShort("width", m_Map->GetWidth());
109 a_Writer.AddShort("height", m_Map->GetHeight());
110
111 a_Writer.AddInt("xCenter", m_Map->GetCenterX());
112 a_Writer.AddInt("zCenter", m_Map->GetCenterZ());
113
114 const cMap::cColorList & Data = m_Map->GetData();
115 a_Writer.AddByteArray("colors", (char *) &Data[0], Data.size());
116
117 a_Writer.EndCompound();
118}
119
120
121

Callers

nothing calls this directly

Calls 14

BeginCompoundMethod · 0.80
AddByteMethod · 0.80
GetScaleMethod · 0.80
AddShortMethod · 0.80
AddIntMethod · 0.80
GetCenterXMethod · 0.80
GetCenterZMethod · 0.80
GetDataMethod · 0.80
sizeMethod · 0.80
EndCompoundMethod · 0.80
GetDimensionMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected