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

Method SaveToSchematicString

src/WorldStorage/SchematicFileSerializer.cpp:139–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138
139bool cSchematicFileSerializer::SaveToSchematicString(const cBlockArea & a_BlockArea, AString & a_Out)
140{
141 // Serialize into NBT data:
142 AString NBT = SaveToSchematicNBT(a_BlockArea);
143 if (NBT.empty())
144 {
145 LOG("%s: Cannot serialize the area into an NBT representation.", __FUNCTION__);
146 return false;
147 }
148
149 // Gzip the data:
150 int res = CompressStringGZIP(NBT.data(), NBT.size(), a_Out);
151 if (res != Z_OK)
152 {
153 LOG("%s: Cannot Gzip the area data NBT representation: %d", __FUNCTION__, res);
154 return false;
155 }
156 return true;
157}
158
159
160

Callers

nothing calls this directly

Calls 4

LOGFunction · 0.85
CompressStringGZIPFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected