summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_9.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/Protocol_1_9.cpp')
-rw-r--r--src/Protocol/Protocol_1_9.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp
index 0669e6a1a..0827b8f0b 100644
--- a/src/Protocol/Protocol_1_9.cpp
+++ b/src/Protocol/Protocol_1_9.cpp
@@ -945,14 +945,21 @@ void cProtocol_1_9_0::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer)
HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, Action);
HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, JumpBoost);
+ if (PlayerID != m_Client->GetPlayer()->GetUniqueID())
+ {
+ m_Client->Kick("Mind your own business! Hacked client?");
+ return;
+ }
+
switch (Action)
{
- case 0: m_Client->HandleEntityCrouch(PlayerID, true); break; // Crouch
- case 1: m_Client->HandleEntityCrouch(PlayerID, false); break; // Uncrouch
- case 2: m_Client->HandleEntityLeaveBed(PlayerID); break; // Leave Bed
- case 3: m_Client->HandleEntitySprinting(PlayerID, true); break; // Start sprinting
- case 4: m_Client->HandleEntitySprinting(PlayerID, false); break; // Stop sprinting
- case 7: m_Client->HandleOpenHorseInventory(PlayerID); break; // Open horse inventory
+ case 0: return m_Client->HandleCrouch(true);
+ case 1: return m_Client->HandleCrouch(false);
+ case 2: return m_Client->HandleLeaveBed();
+ case 3: return m_Client->HandleSprint(true);
+ case 4: return m_Client->HandleSprint(false);
+ case 7: return m_Client->HandleOpenHorseInventory();
+ case 8: return m_Client->HandleStartElytraFlight();
}
}
@@ -969,7 +976,7 @@ void cProtocol_1_9_0::HandlePacketPlayerPos(cByteBuffer & a_ByteBuffer)
if (m_IsTeleportIdConfirmed)
{
- m_Client->HandlePlayerPos(PosX, PosY, PosZ, PosY + (m_Client->GetPlayer()->IsCrouched() ? 1.54 : 1.62), IsOnGround);
+ m_Client->HandlePlayerPos(PosX, PosY, PosZ, IsOnGround);
}
}
@@ -988,7 +995,7 @@ void cProtocol_1_9_0::HandlePacketPlayerPosLook(cByteBuffer & a_ByteBuffer)
if (m_IsTeleportIdConfirmed)
{
- m_Client->HandlePlayerMoveLook(PosX, PosY, PosZ, PosY + 1.62, Yaw, Pitch, IsOnGround);
+ m_Client->HandlePlayerMoveLook(PosX, PosY, PosZ, Yaw, Pitch, IsOnGround);
}
}
@@ -1666,6 +1673,10 @@ void cProtocol_1_9_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a
{
Flags |= 0x20;
}
+ if (a_Entity.IsElytraFlying())
+ {
+ Flags |= 0x80;
+ }
a_Pkt.WriteBEUInt8(0); // Index 0
a_Pkt.WriteBEUInt8(METADATA_TYPE_BYTE); // Type
a_Pkt.WriteBEInt8(Flags);