Fix interact entity not being correctly implemented 1.16+

This commit is contained in:
ReinforceZwei 2020-11-02 22:17:03 +08:00 committed by ORelio
parent d3ea597dd1
commit 0c3f774c07

View file

@ -1595,6 +1595,11 @@ namespace MinecraftClient.Protocol.Handlers
fields.AddRange(dataTypes.GetFloat(Y)); fields.AddRange(dataTypes.GetFloat(Y));
fields.AddRange(dataTypes.GetFloat(Z)); fields.AddRange(dataTypes.GetFloat(Z));
fields.AddRange(dataTypes.GetVarInt(hand)); 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); SendPacket(PacketTypesOut.InteractEntity, fields);
return true; return true;
} }
@ -1610,6 +1615,11 @@ namespace MinecraftClient.Protocol.Handlers
fields.AddRange(dataTypes.GetVarInt(EntityID)); fields.AddRange(dataTypes.GetVarInt(EntityID));
fields.AddRange(dataTypes.GetVarInt(type)); fields.AddRange(dataTypes.GetVarInt(type));
fields.AddRange(dataTypes.GetVarInt(hand)); 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); SendPacket(PacketTypesOut.InteractEntity, fields);
return true; return true;
} }