mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed crash on 1.8 when receiving entity data
This commit is contained in:
parent
f855839bb3
commit
d90635f40b
1 changed files with 9 additions and 5 deletions
|
|
@ -504,6 +504,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
|
|
||||||
int metadata = -1;
|
int metadata = -1;
|
||||||
|
bool hasData = false;
|
||||||
byte entityPitch, entityYaw;
|
byte entityPitch, entityYaw;
|
||||||
|
|
||||||
if (living)
|
if (living)
|
||||||
|
|
@ -522,13 +523,16 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
if (protocolversion >= Protocol18Handler.MC_1_19_Version)
|
if (protocolversion >= Protocol18Handler.MC_1_19_Version)
|
||||||
ReadNextVarInt(cache);
|
hasData = ReadNextVarInt(cache) == 1;
|
||||||
else ReadNextInt(cache);
|
else hasData = ReadNextInt(cache) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
short velocityX = ReadNextShort(cache);
|
if (hasData)
|
||||||
short velocityY = ReadNextShort(cache);
|
{
|
||||||
short velocityZ = ReadNextShort(cache);
|
short velocityX = ReadNextShort(cache);
|
||||||
|
short velocityY = ReadNextShort(cache);
|
||||||
|
short velocityZ = 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, metadata);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue