diff options
author | NiLSPACE <NiLSPACE@users.noreply.github.com> | 2015-07-15 09:57:04 +0200 |
---|---|---|
committer | NiLSPACE <NiLSPACE@users.noreply.github.com> | 2015-07-15 09:57:04 +0200 |
commit | 0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5 (patch) | |
tree | e29fa5cb0cab2d31279a73a80cd307de07ab8356 /src/WorldStorage/NBTChunkSerializer.cpp | |
parent | Updated submodules (diff) | |
parent | Support ageable mobs (diff) | |
download | cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.tar cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.tar.gz cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.tar.bz2 cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.tar.lz cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.tar.xz cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.tar.zst cuberite-0c3a3427cd6ace46f52b80f6815d10b2ea12f4e5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/NBTChunkSerializer.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 10231ae3b..234c60d62 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -554,6 +554,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) m_Writer.AddInt ("Style", Horse.GetHorseStyle()); m_Writer.AddInt ("ArmorType", Horse.GetHorseArmour()); m_Writer.AddByte("Saddle", Horse.IsSaddled()); + m_Writer.AddByte("Age", Horse.GetAge()); break; } case mtMagmaCube: @@ -565,6 +566,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) { m_Writer.AddByte("Sheared", ((const cSheep *)a_Monster)->IsSheared()); m_Writer.AddByte("Color", ((const cSheep *)a_Monster)->GetFurColor()); + m_Writer.AddByte("Age", ((const cSheep *)a_Monster)->GetAge()); break; } case mtSlime: @@ -580,6 +582,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) case mtVillager: { m_Writer.AddInt("Profession", ((const cVillager *)a_Monster)->GetVilType()); + m_Writer.AddByte("Age", ((const cVillager *)a_Monster)->GetAge()); break; } case mtWither: @@ -601,13 +604,37 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) m_Writer.AddByte("Sitting", Wolf.IsSitting() ? 1 : 0); m_Writer.AddByte("Angry", Wolf.IsAngry() ? 1 : 0); m_Writer.AddByte("CollarColor", (unsigned char)Wolf.GetCollarColor()); + m_Writer.AddByte("Age", Wolf.GetAge()); break; } case mtZombie: { m_Writer.AddByte("IsVillager", (((const cZombie *)a_Monster)->IsVillagerZombie() ? 1 : 0)); - m_Writer.AddByte("IsBaby", (((const cZombie *)a_Monster)->IsBaby() ? 1 : 0)); m_Writer.AddByte("IsConverting", (((const cZombie *)a_Monster)->IsConverting() ? 1 : 0)); + m_Writer.AddByte("Age", (((const cZombie *)a_Monster)->GetAge())); + break; + } + case mtZombiePigman: + { + m_Writer.AddByte("Age", (((const cZombiePigman *)a_Monster)->GetAge())); + break; + } + case mtOcelot: + { + const cOcelot & Ocelot = *((cOcelot *)a_Monster); + m_Writer.AddByte("Age", Ocelot.GetAge()); + break; + } + case mtPig: + { + const cPig & Pig = *((cPig *)a_Monster); + m_Writer.AddByte("Age", Pig.GetAge()); + break; + } + case mtRabbit: + { + const cRabbit & Rabbit = *((cRabbit *)a_Monster); + m_Writer.AddByte("Age", Rabbit.GetAge()); break; } case mtInvalidType: @@ -621,15 +648,11 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) case mtGuardian: case mtIronGolem: case mtMooshroom: - case mtOcelot: - case mtPig: - case mtRabbit: case mtSilverfish: case mtSnowGolem: case mtSpider: case mtSquid: case mtWitch: - case mtZombiePigman: { // Other mobs have no special tags. break; |