summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/NBTChunkSerializer.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2017-07-12 12:42:02 +0200
committerLukas Pioch <lukas@zgow.de>2017-07-12 12:42:02 +0200
commit6a1984112146a14c96f43e9cdf758f5104d6d2a3 (patch)
tree373b218beaad1ddfe76e29eb1a6370c6bc0e4624 /src/WorldStorage/NBTChunkSerializer.cpp
parentLua plugin cColor (#3833) (diff)
downloadcuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.tar
cuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.tar.gz
cuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.tar.bz2
cuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.tar.lz
cuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.tar.xz
cuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.tar.zst
cuberite-6a1984112146a14c96f43e9cdf758f5104d6d2a3.zip
Diffstat (limited to 'src/WorldStorage/NBTChunkSerializer.cpp')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index d61e61879..ecc7a550a 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -670,7 +670,18 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
}
case mtOcelot:
{
- m_Writer.AddInt("Age", reinterpret_cast<const cOcelot *>(a_Monster)->GetAge());
+ const auto *Ocelot = reinterpret_cast<const cOcelot *>(a_Monster);
+ if (!Ocelot->GetOwnerName().empty())
+ {
+ m_Writer.AddString("Owner", Ocelot->GetOwnerName());
+ }
+ if (!Ocelot->GetOwnerUUID().empty())
+ {
+ m_Writer.AddString("OwnerUUID", Ocelot->GetOwnerUUID());
+ }
+ m_Writer.AddByte("Sitting", Ocelot->IsSitting() ? 1 : 0);
+ m_Writer.AddInt ("CatType", Ocelot->GetOcelotType());
+ m_Writer.AddInt ("Age", Ocelot->GetAge());
break;
}
case mtPig: