feat: Add automatic mining-speed and dig-duration handling

This commit is contained in:
Anon 2026-03-30 21:41:06 +02:00 committed by GitHub
commit d5358d3d1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1965 additions and 4 deletions

View file

@ -2514,7 +2514,7 @@ namespace MinecraftClient.Protocol.Handlers
if (handler.GetEntityHandlingEnabled())
{
var entityId = dataTypes.ReadNextVarInt(packetData);
var effectId = protocolVersion >= MC_1_18_2_Version
var effectId = protocolVersion >= MC_1_20_4_Version
? dataTypes.ReadNextVarInt(packetData) + 1
: dataTypes.ReadNextByte(packetData);
@ -2544,7 +2544,7 @@ namespace MinecraftClient.Protocol.Handlers
if (handler.GetEntityHandlingEnabled())
{
var entityId = dataTypes.ReadNextVarInt(packetData);
var effectId = protocolVersion >= MC_1_18_2_Version
var effectId = protocolVersion >= MC_1_20_4_Version
? dataTypes.ReadNextVarInt(packetData) + 1
: dataTypes.ReadNextByte(packetData);