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

Method SaveToJson

src/BlockEntities/DropSpenserEntity.cpp:174–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173
174void cDropSpenserEntity::SaveToJson(Json::Value & a_Value)
175{
176 a_Value["x"] = m_PosX;
177 a_Value["y"] = m_PosY;
178 a_Value["z"] = m_PosZ;
179
180 Json::Value AllSlots;
181 int NumSlots = m_Contents.GetNumSlots();
182 for (int i = 0; i < NumSlots; i++)
183 {
184 Json::Value Slot;
185 m_Contents.GetSlot(i).GetJson(Slot);
186 AllSlots.append(Slot);
187 }
188 a_Value["Slots"] = AllSlots;
189}
190
191
192

Callers

nothing calls this directly

Calls 3

GetJsonMethod · 0.80
GetNumSlotsMethod · 0.45
GetSlotMethod · 0.45

Tested by

no test coverage detected