4jcraft/Minecraft.World/Network/Packets/SetEntityMotionPacket.h
MathiewMay 41d8202c47 applied changes requested by tropicaaal
"i would prefer that these be cast to sized integer types int8_t for portability reasons."

 "The light layer changes are ultimately a hack over the broken renderer implementation and probably out of scope for this PR. There's an in-progress fix for the root cause of this, so this should be removed."

 "std::numeric_limits<int16_t>::max()"
2026-03-10 18:20:33 -04:00

31 lines
845 B
C++

#pragma once
#include "Packet.h"
class SetEntityMotionPacket : public Packet, public std::enable_shared_from_this<SetEntityMotionPacket>
{
public:
int id;
int16_t xa, ya, za;
bool useBytes; // 4J added
private:
void _init(int id, double xd, double yd, double zd);
public:
SetEntityMotionPacket();
SetEntityMotionPacket(std::shared_ptr<Entity> e);
SetEntityMotionPacket(int id, double xd, double yd, double zd);
virtual void read(DataInputStream *dis);
virtual void write(DataOutputStream *dos);
virtual void handle(PacketListener *listener);
virtual int getEstimatedSize();
virtual bool canBeInvalidated();
virtual bool isInvalidatedBy(std::shared_ptr<Packet> packet);
public:
static std::shared_ptr<Packet> create() { return std::shared_ptr<Packet>(new SetEntityMotionPacket()); }
virtual int getId() { return 28; }
};