4th batch

This commit is contained in:
Leah Anderson
2026-03-02 12:00:59 -07:00
parent 9cfc2e5b16
commit 79c1737c34
33 changed files with 94 additions and 93 deletions

View File

@@ -16,8 +16,8 @@ void AddEntityPacket::_init(shared_ptr<Entity> e, int type, int data, int xp, in
x = xp;//(int) floor(e->x * 32);
y = yp;//(int) floor(e->y * 32);
z = zp;//(int) floor(e->z * 32);
yRot = static_cast<std::byte>(yRotp);
xRot = static_cast<std::byte>(xRotp);
yRot = static_cast<byte>(yRotp);
xRot = static_cast<byte>(xRotp);
this->type = type;
this->data = data;
if (data > -1) // 4J - changed "no data" value to be -1, we can have a valid entity id of 0
@@ -55,7 +55,7 @@ AddEntityPacket::AddEntityPacket(shared_ptr<Entity> e, int type, int data, int y
void AddEntityPacket::read(DataInputStream *dis) // throws IOException TODO 4J JEV add throws statement
{
id = dis->readShort();
type = std::to_integer<int>(dis->readByte());
type = dis->readByte();
#ifdef _LARGE_WORLDS
x = dis->readInt();
y = dis->readInt();
@@ -79,7 +79,7 @@ void AddEntityPacket::read(DataInputStream *dis) // throws IOException TODO 4J
void AddEntityPacket::write(DataOutputStream *dos) // throws IOException TODO 4J JEV add throws statement
{
dos->writeShort(id);
dos->writeByte(static_cast<std::byte>(type));
dos->writeByte(static_cast<byte>(type));
#ifdef _LARGE_WORLDS
dos->writeInt(x);
dos->writeInt(y);