diff options
author | Mattes D <github@xoft.cz> | 2014-12-21 15:18:42 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-21 15:18:42 +0100 |
commit | d4c9daddb89cc8066f3fe36939447acbcf6c7400 (patch) | |
tree | af1a179ba5ac87c652b6e271c99628dee1ceb920 /src/WorldStorage | |
parent | Merge branch 'master' of https://github.com/mc-server/MCServer (diff) | |
parent | Fixed damn empty line with no use (diff) | |
download | cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.gz cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.bz2 cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.lz cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.xz cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.zst cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.zip |
Diffstat (limited to 'src/WorldStorage')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 2 | ||||
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 24 | ||||
-rwxr-xr-x | src/WorldStorage/WSSAnvil.h | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 9d8e20b0b..c87397542 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -502,6 +502,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) case mtMooshroom: EntityClass = "MushroomCow"; break; case mtOcelot: EntityClass = "Ozelot"; break; case mtPig: EntityClass = "Pig"; break; + case mtRabbit: EntityClass = "Rabbit"; break; case mtSheep: EntityClass = "Sheep"; break; case mtSilverfish: EntityClass = "Silverfish"; break; case mtSkeleton: EntityClass = "Skeleton"; break; @@ -633,6 +634,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) case mtMooshroom: case mtOcelot: case mtPig: + case mtRabbit: case mtSilverfish: case mtSnowGolem: case mtSpider: diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index a045497bc..cf51ab19c 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1442,6 +1442,10 @@ void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a { LoadPigFromNBT(a_Entities, a_NBT, a_EntityTagIdx); } + else if (strncmp(a_IDTag, "Rabbit", a_IDTagLength) == 0) + { + LoadRabbitFromNBT(a_Entities, a_NBT, a_EntityTagIdx); + } else if (strncmp(a_IDTag, "Sheep", a_IDTagLength) == 0) { LoadSheepFromNBT(a_Entities, a_NBT, a_EntityTagIdx); @@ -2363,6 +2367,26 @@ void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB +void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) +{ + std::unique_ptr<cRabbit> Monster(new cRabbit()); + 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::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { int ColorIdx = a_NBT.FindChildByName(a_TagIdx, "Color"); diff --git a/src/WorldStorage/WSSAnvil.h b/src/WorldStorage/WSSAnvil.h index 7bcdd259e..362796614 100755 --- a/src/WorldStorage/WSSAnvil.h +++ b/src/WorldStorage/WSSAnvil.h @@ -198,6 +198,7 @@ protected: void LoadMooshroomFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); void LoadOcelotFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); void LoadPigFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); + void LoadRabbitFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); void LoadSheepFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); void LoadSilverfishFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); void LoadSkeletonFromNBT (cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx); |