From 5b4319556d0ba3703ffd65c93f0b15f67ab394fa Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Wed, 11 Mar 2026 00:20:23 -0500 Subject: [PATCH] refactor: remove redundant casts in MoveEntityPacket --- .../Network/Packets/MoveEntityPacket.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Minecraft.World/Network/Packets/MoveEntityPacket.cpp b/Minecraft.World/Network/Packets/MoveEntityPacket.cpp index 6b5cc94c8..241f5f021 100644 --- a/Minecraft.World/Network/Packets/MoveEntityPacket.cpp +++ b/Minecraft.World/Network/Packets/MoveEntityPacket.cpp @@ -71,22 +71,22 @@ MoveEntityPacket::PosRot::PosRot() MoveEntityPacket::PosRot::PosRot(int id, int8_t xa, int8_t ya, int8_t za, int8_t yRot, int8_t xRot) : MoveEntityPacket( id ) { - this->xa = (int)(int8_t)xa; - this->ya = (int)(int8_t)ya; - this->za = (int)(int8_t)za; - this->yRot = (int)(int8_t)yRot; - this->xRot = (int)(int8_t)xRot; + this->xa = xa; + this->ya = ya; + this->za = za; + this->yRot = yRot; + this->xRot = xRot; hasRot = true; } void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); - xa = (int)(int8_t)dis->readByte(); - ya = (int)(int8_t)dis->readByte(); - za = (int)(int8_t)dis->readByte(); - yRot = (int)(int8_t)dis->readByte(); - xRot = (int)(int8_t)dis->readByte(); + xa = (int8_t)dis->readByte(); + ya = (int8_t)dis->readByte(); + za = (int8_t)dis->readByte(); + yRot = (int8_t)dis->readByte(); + xRot = (int8_t)dis->readByte(); } void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException @@ -118,9 +118,9 @@ MoveEntityPacket::Pos::Pos(int id, int8_t xa, int8_t ya, int8_t za) : MoveEntity void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); - xa = (int)(int8_t)dis->readByte(); - ya = (int)(int8_t)dis->readByte(); - za = (int)(int8_t)dis->readByte(); + xa = (int8_t)dis->readByte(); + ya = (int8_t)dis->readByte(); + za = (int8_t)dis->readByte(); } void MoveEntityPacket::Pos::write(DataOutputStream *dos) //throws IOException @@ -151,8 +151,8 @@ MoveEntityPacket::Rot::Rot(int id, int8_t yRot, int8_t xRot) : MoveEntityPacket( void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); - yRot = (int)(int8_t)dis->readByte(); - xRot = (int)(int8_t)dis->readByte(); + yRot = (int8_t)dis->readByte(); + xRot = (int8_t)dis->readByte(); } void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException