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
d90635f40b
commit
03b06ea3ac
1 changed files with 15 additions and 5 deletions
|
|
@ -523,15 +523,25 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
if (protocolversion >= Protocol18Handler.MC_1_19_Version)
|
if (protocolversion >= Protocol18Handler.MC_1_19_Version)
|
||||||
hasData = ReadNextVarInt(cache) == 1;
|
ReadNextVarInt(cache);
|
||||||
else hasData = ReadNextInt(cache) == 1;
|
else hasData = ReadNextInt(cache) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In 1.8 those 3 fields for Velocity are optional
|
||||||
|
if (protocolversion < Protocol18Handler.MC_1_9_Version)
|
||||||
|
{
|
||||||
if (hasData)
|
if (hasData)
|
||||||
{
|
{
|
||||||
short velocityX = ReadNextShort(cache);
|
ReadNextShort(cache);
|
||||||
short velocityY = ReadNextShort(cache);
|
ReadNextShort(cache);
|
||||||
short velocityZ = ReadNextShort(cache);
|
ReadNextShort(cache);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ReadNextShort(cache);
|
||||||
|
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, metadata);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue