diff options
author | peterbell10 <peterbell10@live.co.uk> | 2017-09-14 10:48:57 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2017-09-14 10:48:57 +0200 |
commit | 307e7aaff5c454b703db4d536c40d5715d96032b (patch) | |
tree | e217d6a073e6b87aaeb6618a933676d3251b9355 /src/Protocol/Protocol_1_10.cpp | |
parent | Updated compile.sh script (#4009) (diff) | |
download | cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.tar cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.tar.gz cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.tar.bz2 cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.tar.lz cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.tar.xz cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.tar.zst cuberite-307e7aaff5c454b703db4d536c40d5715d96032b.zip |
Diffstat (limited to 'src/Protocol/Protocol_1_10.cpp')
-rw-r--r-- | src/Protocol/Protocol_1_10.cpp | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/src/Protocol/Protocol_1_10.cpp b/src/Protocol/Protocol_1_10.cpp index bb29c58ce..a16ad3143 100644 --- a/src/Protocol/Protocol_1_10.cpp +++ b/src/Protocol/Protocol_1_10.cpp @@ -707,6 +707,26 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_ break; } // case mtBat + case mtChicken: + { + auto & Chicken = reinterpret_cast<const cChicken &>(a_Mob); + + a_Pkt.WriteBEUInt8(AGEABLE_BABY); + a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); + a_Pkt.WriteBool(Chicken.IsBaby()); + break; + } // case mtChicken + + case mtCow: + { + auto & Cow = reinterpret_cast<const cCow &>(a_Mob); + + a_Pkt.WriteBEUInt8(AGEABLE_BABY); + a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); + a_Pkt.WriteBool(Cow.IsBaby()); + break; + } // case mtCow + case mtCreeper: { auto & Creeper = reinterpret_cast<const cCreeper &>(a_Mob); @@ -821,26 +841,6 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_ break; } // case mtOcelot - case mtCow: - { - auto & Cow = reinterpret_cast<const cCow &>(a_Mob); - - a_Pkt.WriteBEUInt8(AGEABLE_BABY); - a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); - a_Pkt.WriteBool(Cow.IsBaby()); - break; - } // case mtCow - - case mtChicken: - { - auto & Chicken = reinterpret_cast<const cChicken &>(a_Mob); - - a_Pkt.WriteBEUInt8(AGEABLE_BABY); - a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); - a_Pkt.WriteBool(Chicken.IsBaby()); - break; - } // case mtChicken - case mtPig: { auto & Pig = reinterpret_cast<const cPig &>(a_Mob); @@ -856,6 +856,19 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_ break; } // case mtPig + case mtRabbit: + { + auto & Rabbit = reinterpret_cast<const cRabbit &>(a_Mob); + a_Pkt.WriteBEUInt8(AGEABLE_BABY); + a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); + a_Pkt.WriteBool(Rabbit.IsBaby()); + + a_Pkt.WriteBEUInt8(RABBIT_TYPE); + a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT); + a_Pkt.WriteVarInt32(static_cast<UInt32>(Rabbit.GetRabbitType())); + break; + } // case mtRabbit + case mtSheep: { auto & Sheep = reinterpret_cast<const cSheep &>(a_Mob); @@ -876,19 +889,6 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_ break; } // case mtSheep - case mtRabbit: - { - auto & Rabbit = reinterpret_cast<const cRabbit &>(a_Mob); - a_Pkt.WriteBEUInt8(AGEABLE_BABY); - a_Pkt.WriteBEUInt8(METADATA_TYPE_BOOL); - a_Pkt.WriteBool(Rabbit.IsBaby()); - - a_Pkt.WriteBEUInt8(RABBIT_TYPE); - a_Pkt.WriteBEUInt8(METADATA_TYPE_VARINT); - a_Pkt.WriteVarInt32(static_cast<UInt32>(Rabbit.GetRabbitType())); - break; - } // case mtRabbit - case mtSkeleton: { auto & Skeleton = reinterpret_cast<const cSkeleton &>(a_Mob); @@ -1003,5 +1003,7 @@ void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_ a_Pkt.WriteBool(ZombiePigman.IsBaby()); break; } // case mtZombiePigman + + default: break; } // switch (a_Mob.GetType()) } |