diff options
author | Safwat Halaby <SafwatHalaby@users.noreply.github.com> | 2015-11-30 07:58:02 +0100 |
---|---|---|
committer | Safwat Halaby <SafwatHalaby@users.noreply.github.com> | 2015-11-30 07:58:02 +0100 |
commit | 1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9 (patch) | |
tree | 0da79374832cae75ae5d9e6822712b3b62cbdbe8 /src/Protocol | |
parent | Updated DumpInfo plugin (diff) | |
parent | implement breeding (diff) | |
download | cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.gz cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.bz2 cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.lz cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.xz cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.tar.zst cuberite-1a9c023d6c69d5aa37ed0d3726e0f4af77b974f9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 373269509..833746c00 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -3368,7 +3368,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) a_Pkt.WriteBEUInt8(0x56); // Int at index 22 a_Pkt.WriteBEInt32(Horse.GetHorseArmour()); a_Pkt.WriteBEUInt8(0x0c); - a_Pkt.WriteBEInt8(Horse.IsBaby() ? -1 : 0); + a_Pkt.WriteBEInt8(Horse.IsBaby() ? -1 : (Horse.IsInLoveCooldown() ? 1 : 0)); break; } // case mtHorse @@ -3384,15 +3384,31 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) { auto & Ocelot = reinterpret_cast<const cOcelot &>(a_Mob); a_Pkt.WriteBEUInt8(0x0c); - a_Pkt.WriteBEInt8(Ocelot.IsBaby() ? -1 : 0); + a_Pkt.WriteBEInt8(Ocelot.IsBaby() ? -1 : (Ocelot.IsInLoveCooldown() ? 1 : 0)); break; } // case mtOcelot + case mtCow: + { + auto & Cow = reinterpret_cast<const cCow &>(a_Mob); + a_Pkt.WriteBEUInt8(0x0c); + a_Pkt.WriteBEInt8(Cow.IsBaby() ? -1 : (Cow.IsInLoveCooldown() ? 1 : 0)); + break; + } // case mtCow + + case mtChicken: + { + auto & Chicken = reinterpret_cast<const cChicken &>(a_Mob); + a_Pkt.WriteBEUInt8(0x0c); + a_Pkt.WriteBEInt8(Chicken.IsBaby() ? -1 : (Chicken.IsInLoveCooldown() ? 1 : 0)); + break; + } // case mtChicken + case mtPig: { auto & Pig = reinterpret_cast<const cPig &>(a_Mob); a_Pkt.WriteBEUInt8(0x0c); - a_Pkt.WriteBEInt8(Pig.IsBaby() ? -1 : 0); + a_Pkt.WriteBEInt8(Pig.IsBaby() ? -1 : (Pig.IsInLoveCooldown() ? 1 : 0)); a_Pkt.WriteBEUInt8(0x10); a_Pkt.WriteBEUInt8(Pig.IsSaddled() ? 1 : 0); break; @@ -3402,7 +3418,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) { auto & Sheep = reinterpret_cast<const cSheep &>(a_Mob); a_Pkt.WriteBEUInt8(0x0c); - a_Pkt.WriteBEInt8(Sheep.IsBaby() ? -1 : 0); + a_Pkt.WriteBEInt8(Sheep.IsBaby() ? -1 : (Sheep.IsInLoveCooldown() ? 1 : 0)); a_Pkt.WriteBEUInt8(0x10); Byte SheepMetadata = 0; @@ -3421,7 +3437,7 @@ void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) a_Pkt.WriteBEUInt8(0x12); a_Pkt.WriteBEUInt8(Rabbit.GetRabbitTypeAsNumber()); a_Pkt.WriteBEUInt8(0x0c); - a_Pkt.WriteBEInt8(Rabbit.IsBaby() ? -1 : 0); + a_Pkt.WriteBEInt8(Rabbit.IsBaby() ? -1 : (Rabbit.IsInLoveCooldown() ? 1 : 0)); break; } // case mtRabbit |