summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorMasy98 <masy@antheruscraft.de>2014-12-18 19:30:32 +0100
committerMasy98 <masy@antheruscraft.de>2014-12-18 19:30:32 +0100
commitc836b52dd1b8d6a2999721f235e6c2b6079b266c (patch)
treeae04bd279e3bddb94119ce0b9f9aed9344f8f140 /src/WorldStorage/WSSAnvil.cpp
parentClang needs the libstdc++ that comes with gcc-4.8 (diff)
downloadcuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.tar
cuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.tar.gz
cuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.tar.bz2
cuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.tar.lz
cuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.tar.xz
cuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.tar.zst
cuberite-c836b52dd1b8d6a2999721f235e6c2b6079b266c.zip
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp24
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");