From 0c3f774c07df2e9f00aa4aae81a1e54008d71bd3 Mon Sep 17 00:00:00 2001 From: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com> Date: Mon, 2 Nov 2020 22:17:03 +0800 Subject: [PATCH] Fix interact entity not being correctly implemented 1.16+ --- MinecraftClient/Protocol/Handlers/Protocol18.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 9e13415e..afea9bb8 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -1573,7 +1573,7 @@ namespace MinecraftClient.Protocol.Handlers // Currently hardcoded to false // TODO: Update to reflect the real player state if (protocolversion >= MC116Version) - fields.AddRange(dataTypes.GetBool(false)); + fields.AddRange(dataTypes.GetBool(false)); SendPacket(PacketTypesOut.InteractEntity, fields); return true; @@ -1595,6 +1595,11 @@ namespace MinecraftClient.Protocol.Handlers fields.AddRange(dataTypes.GetFloat(Y)); fields.AddRange(dataTypes.GetFloat(Z)); fields.AddRange(dataTypes.GetVarInt(hand)); + // Is player Sneaking (Only 1.16 and above) + // Currently hardcoded to false + // TODO: Update to reflect the real player state + if (protocolversion >= MC116Version) + fields.AddRange(dataTypes.GetBool(false)); SendPacket(PacketTypesOut.InteractEntity, fields); return true; } @@ -1610,6 +1615,11 @@ namespace MinecraftClient.Protocol.Handlers fields.AddRange(dataTypes.GetVarInt(EntityID)); fields.AddRange(dataTypes.GetVarInt(type)); fields.AddRange(dataTypes.GetVarInt(hand)); + // Is player Sneaking (Only 1.16 and above) + // Currently hardcoded to false + // TODO: Update to reflect the real player state + if (protocolversion >= MC116Version) + fields.AddRange(dataTypes.GetBool(false)); SendPacket(PacketTypesOut.InteractEntity, fields); return true; }