Fixed Auto Fishing not working

Fixed Auto Fishing not working
This commit is contained in:
Anon 2023-05-10 22:21:54 +02:00 committed by GitHub
commit 4ff7712f20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -501,10 +501,8 @@ namespace MinecraftClient.Protocol.Handlers
entityY = ReadNextDouble(cache); // Y entityY = ReadNextDouble(cache); // Y
entityZ = ReadNextDouble(cache); // Z entityZ = ReadNextDouble(cache); // Z
} }
int data = -1;
int metadata = -1;
bool hasData = false;
byte entityPitch, entityYaw; byte entityPitch, entityYaw;
if (living) if (living)
@ -522,15 +520,14 @@ namespace MinecraftClient.Protocol.Handlers
entityYaw = ReadNextByte(cache); // Head Yaw entityYaw = ReadNextByte(cache); // Head Yaw
// Data // Data
if (protocolversion >= Protocol18Handler.MC_1_19_Version) data = protocolversion >= Protocol18Handler.MC_1_19_Version
ReadNextVarInt(cache); ? ReadNextVarInt(cache) : ReadNextInt(cache);
else hasData = ReadNextInt(cache) == 1;
} }
// In 1.8 those 3 fields for Velocity are optional // In 1.8 those 3 fields for Velocity are optional
if (protocolversion < Protocol18Handler.MC_1_9_Version) if (protocolversion < Protocol18Handler.MC_1_9_Version)
{ {
if (hasData) if (data != 0)
{ {
ReadNextShort(cache); ReadNextShort(cache);
ReadNextShort(cache); ReadNextShort(cache);
@ -544,7 +541,7 @@ namespace MinecraftClient.Protocol.Handlers
ReadNextShort(cache); ReadNextShort(cache);
} }
return new Entity(entityID, entityType, new Location(entityX, entityY, entityZ), entityYaw, entityPitch, metadata); return new Entity(entityID, entityType, new Location(entityX, entityY, entityZ), entityYaw, entityPitch, data);
} }
/// <summary> /// <summary>