diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-12-21 12:57:01 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-12-21 12:57:01 +0100 |
commit | 9755c5ba699493b3aa18ad4927f5a6a87e991e3b (patch) | |
tree | cc9a83ff0b5c87e4edd31f0785b14c902d577768 /src/WorldStorage/WSSAnvil.cpp | |
parent | Fix repeater unpowering (diff) | |
parent | Merge pull request #1680 from Masy98/entities (diff) | |
download | cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.gz cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.bz2 cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.lz cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.xz cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.zst cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.zip |
Diffstat (limited to '')
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index af65db700..a045497bc 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1410,6 +1410,10 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a { LoadGiantFromNBT(a_Entities, a_NBT, a_EntityTagIdx); } + else if (strncmp(a_IDTag, "Guardian", a_IDTagLength) == 0) + { + LoadGuardianFromNBT(a_Entities, a_NBT, a_EntityTagIdx); + } else if (strncmp(a_IDTag, "Horse", a_IDTagLength) == 0) { LoadHorseFromNBT(a_Entities, a_NBT, a_EntityTagIdx); @@ -2197,6 +2201,26 @@ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ +void cWSSAnvil::LoadGuardianFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) +{ + std::unique_ptr<cGuardian> Monster(new cGuardian()); + if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) + { + return; + } + + if (!LoadMonsterBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) + { + return; + } + + a_Entities.push_back(Monster.release()); +} + + + + + void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { int TypeIdx = a_NBT.FindChildByName(a_TagIdx, "Type"); |