mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed entity rotations (#2596)
* Fixed entity rotations Fixed entity yaw and pitch not changing when entity moves head. * Update ChatBot.cs * Update McClient.cs * Update Protocol18.cs * Update McClient.cs * Finalize code style * Fix incorrect variable type --------- Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>
This commit is contained in:
parent
c3fa413b4e
commit
1aea8d3a4e
4 changed files with 85 additions and 3 deletions
|
|
@ -2117,14 +2117,28 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
}
|
||||
|
||||
|
||||
byte _yaw = dataTypes.ReadNextByte(packetData);
|
||||
byte _pitch = dataTypes.ReadNextByte(packetData);
|
||||
float _yaw = dataTypes.ReadNextByte(packetData) * (1F / 256) * 360;
|
||||
float _pitch = dataTypes.ReadNextByte(packetData) * (1F / 256) * 360;
|
||||
bool OnGround = dataTypes.ReadNextBool(packetData);
|
||||
DeltaX = DeltaX / (128 * 32);
|
||||
DeltaY = DeltaY / (128 * 32);
|
||||
DeltaZ = DeltaZ / (128 * 32);
|
||||
|
||||
handler.OnEntityPosition(EntityID, DeltaX, DeltaY, DeltaZ, OnGround);
|
||||
handler.OnEntityPosition(EntityID, DeltaX, DeltaY, DeltaZ, _yaw, _pitch, OnGround);
|
||||
}
|
||||
|
||||
break;
|
||||
case PacketTypesIn.EntityRotation:
|
||||
if (handler.GetEntityHandlingEnabled())
|
||||
{
|
||||
int EntityID = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
|
||||
float _yaw = dataTypes.ReadNextByte(packetData) * (1F / 256) * 360;
|
||||
float _pitch = dataTypes.ReadNextByte(packetData)* (1F / 256) * 360;
|
||||
bool OnGround = dataTypes.ReadNextBool(packetData);
|
||||
|
||||
handler.OnEntityRotation(EntityID, _yaw, _pitch, OnGround);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue