diff options
author | Bond-009 <bond.009@outlook.com> | 2017-07-12 12:42:02 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-07-12 12:42:02 +0200 |
commit | 6a1984112146a14c96f43e9cdf758f5104d6d2a3 (patch) | |
tree | 373b218beaad1ddfe76e29eb1a6370c6bc0e4624 /src/Protocol | |
parent | Lua plugin cColor (#3833) (diff) | |
download | cuberite-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/Protocol')
-rw-r--r-- | src/Protocol/Protocol_1_11.cpp | 18 | ||||
-rw-r--r-- | src/Protocol/Protocol_1_12.cpp | 18 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/Protocol/Protocol_1_11.cpp b/src/Protocol/Protocol_1_11.cpp index e4aaa8f6f..3376e8f88 100644 --- a/src/Protocol/Protocol_1_11.cpp +++ b/src/Protocol/Protocol_1_11.cpp @@ -956,6 +956,24 @@ void cProtocol_1_11_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_ a_Pkt.WriteBEUInt8(AGEABLE_BABY); a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); a_Pkt.WriteBool(Ocelot.IsBaby()); + + Int8 OcelotStatus = 0; + if (Ocelot.IsSitting()) + { + OcelotStatus |= 0x1; + } + if (Ocelot.IsTame()) + { + OcelotStatus |= 0x4; + } + a_Pkt.WriteBEUInt8(TAMEABLE_ANIMAL_STATUS); + a_Pkt.WriteBEUInt8(METADATA_TYPE_BYTE); + a_Pkt.WriteBEInt8(OcelotStatus); + + a_Pkt.WriteBEUInt8(OCELOT_TYPE); + a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT); + a_Pkt.WriteVarInt32(static_cast<UInt32>(Ocelot.GetOcelotType())); + break; } // case mtOcelot diff --git a/src/Protocol/Protocol_1_12.cpp b/src/Protocol/Protocol_1_12.cpp index a702361b2..a25ac1c0d 100644 --- a/src/Protocol/Protocol_1_12.cpp +++ b/src/Protocol/Protocol_1_12.cpp @@ -769,6 +769,24 @@ void cProtocol_1_12::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mo a_Pkt.WriteBEUInt8(AGEABLE_BABY); a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); a_Pkt.WriteBool(Ocelot.IsBaby()); + + Int8 OcelotStatus = 0; + if (Ocelot.IsSitting()) + { + OcelotStatus |= 0x1; + } + if (Ocelot.IsTame()) + { + OcelotStatus |= 0x4; + } + a_Pkt.WriteBEUInt8(TAMEABLE_ANIMAL_STATUS); + a_Pkt.WriteBEUInt8(METADATA_TYPE_BYTE); + a_Pkt.WriteBEInt8(OcelotStatus); + + a_Pkt.WriteBEUInt8(OCELOT_TYPE); + a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT); + a_Pkt.WriteVarInt32(static_cast<UInt32>(Ocelot.GetOcelotType())); + break; } // case mtOcelot |