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

Method HandleServerUpdateTileEntity

Tools/ProtoProxy/Connection.cpp:2495–2526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2493
2494
2495bool cConnection::HandleServerUpdateTileEntity(void)
2496{
2497 HANDLE_SERVER_PACKET_READ(ReadBEInt, int, BlockX);
2498 HANDLE_SERVER_PACKET_READ(ReadBEShort, short, BlockY);
2499 HANDLE_SERVER_PACKET_READ(ReadBEInt, int, BlockZ);
2500 HANDLE_SERVER_PACKET_READ(ReadByte, Byte, Action);
2501 HANDLE_SERVER_PACKET_READ(ReadBEShort, short, DataLength);
2502
2503 AString Data;
2504 if ((DataLength > 0) && !m_ServerBuffer.ReadString(Data, DataLength))
2505 {
2506 return false;
2507 }
2508 Log("Received a PACKET_UPDATE_TILE_ENTITY from the server:");
2509 Log(" Block = {%d, %d, %d}", BlockX, BlockY, BlockZ);
2510 Log(" Action = %d", Action);
2511 DataLog(Data.data(), Data.size(), " Data (%u bytes)", Data.size());
2512
2513 // Save metadata to a file:
2514 AString fnam;
2515 Printf(fnam, "%s_item_%08x.nbt", m_LogNameBase.c_str(), m_ItemIdx++);
2516 FILE * f = fopen(fnam.c_str(), "wb");
2517 if (f != NULL)
2518 {
2519 fwrite(Data.data(), 1, Data.size(), f);
2520 fclose(f);
2521 Log("(saved to file \"%s\")", fnam.c_str());
2522 }
2523
2524 COPY_TO_CLIENT();
2525 return true;
2526}
2527
2528
2529

Callers

nothing calls this directly

Calls 4

PrintfFunction · 0.85
sizeMethod · 0.80
c_strMethod · 0.80
ReadStringMethod · 0.45

Tested by

no test coverage detected