| 1016 | |
| 1017 | |
| 1018 | void cWSSAnvil::LoadCommandBlockFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx) |
| 1019 | { |
| 1020 | ASSERT(a_NBT.GetType(a_TagIdx) == TAG_Compound); |
| 1021 | int x, y, z; |
| 1022 | if (!GetBlockEntityNBTPos(a_NBT, a_TagIdx, x, y, z)) |
| 1023 | { |
| 1024 | return; |
| 1025 | } |
| 1026 | std::auto_ptr<cCommandBlockEntity> CmdBlock(new cCommandBlockEntity(x, y, z, m_World)); |
| 1027 | |
| 1028 | int currentLine = a_NBT.FindChildByName(a_TagIdx, "Command"); |
| 1029 | if (currentLine >= 0) |
| 1030 | { |
| 1031 | CmdBlock->SetCommand(a_NBT.GetString(currentLine)); |
| 1032 | } |
| 1033 | |
| 1034 | currentLine = a_NBT.FindChildByName(a_TagIdx, "SuccessCount"); |
| 1035 | if (currentLine >= 0) |
| 1036 | { |
| 1037 | CmdBlock->SetResult(a_NBT.GetInt(currentLine)); |
| 1038 | } |
| 1039 | |
| 1040 | currentLine = a_NBT.FindChildByName(a_TagIdx, "LastOutput"); |
| 1041 | if (currentLine >= 0) |
| 1042 | { |
| 1043 | CmdBlock->SetLastOutput(a_NBT.GetString(currentLine)); |
| 1044 | } |
| 1045 | |
| 1046 | // TODO 2014-01-18 xdot: Figure out what TrackOutput is and parse it. |
| 1047 | |
| 1048 | a_BlockEntities.push_back(CmdBlock.release()); |
| 1049 | } |
| 1050 | |
| 1051 | |
| 1052 |
nothing calls this directly
no test coverage detected