summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_10.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-04-10 16:57:16 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-04-12 23:35:07 +0200
commita999c5d845bd759c6d83b356c7b39e67473dc452 (patch)
treec8da72f5192293648f30b3228e7563fa7c79d13e /src/Protocol/Protocol_1_10.cpp
parentAdd animations for shield/item block & break (diff)
downloadcuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar
cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.gz
cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.bz2
cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.lz
cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.xz
cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.zst
cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol_1_10.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Protocol/Protocol_1_10.cpp b/src/Protocol/Protocol_1_10.cpp
index 6db08c916..9f4413576 100644
--- a/src/Protocol/Protocol_1_10.cpp
+++ b/src/Protocol/Protocol_1_10.cpp
@@ -329,22 +329,22 @@ void cProtocol_1_10_0::SendSoundEffect(const AString & a_SoundName, double a_X,
-cProtocol::Version cProtocol_1_10_0::GetProtocolVersion()
+UInt32 cProtocol_1_10_0::GetProtocolMobType(const eMonsterType a_MobType) const
{
- return Version::v1_10_0;
+ switch (a_MobType)
+ {
+ case mtPolarBear: return 102;
+ default: return Super::GetProtocolMobType(a_MobType);
+ }
}
-UInt32 cProtocol_1_10_0::GetProtocolMobType(const eMonsterType a_MobType)
+cProtocol::Version cProtocol_1_10_0::GetProtocolVersion() const
{
- switch (a_MobType)
- {
- case mtPolarBear: return 102;
- default: return Super::GetProtocolMobType(a_MobType);
- }
+ return Version::v1_10_0;
}
@@ -360,7 +360,7 @@ void cProtocol_1_10_0::HandlePacketResourcePackStatus(cByteBuffer & a_ByteBuffer
-void cProtocol_1_10_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_Entity)
+void cProtocol_1_10_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_Entity) const
{
using namespace Metadata;
@@ -413,7 +413,7 @@ void cProtocol_1_10_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity &
a_Pkt.WriteBEUInt8(PLAYER_MAIN_HAND);
a_Pkt.WriteBEUInt8(METADATA_TYPE_BYTE);
- a_Pkt.WriteBEUInt8(static_cast<UInt8>(Player.GetMainHand()));
+ a_Pkt.WriteBEUInt8(Player.IsLeftHanded() ? 0 : 1);
break;
}
case cEntity::etPickup:
@@ -581,7 +581,7 @@ void cProtocol_1_10_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity &
-void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
+void cProtocol_1_10_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) const
{
using namespace Metadata;