the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2
3#include "RotateHeadPacket.h"
4
5RotateHeadPacket::RotateHeadPacket()
6{
7}
8
9RotateHeadPacket::RotateHeadPacket(int id, char yHeadRot)
10{
11 this->id = id;
12 this->yHeadRot = yHeadRot;
13}
14
15void RotateHeadPacket::read(DataInputStream *dis)
16{
17 id = dis->readInt();
18 yHeadRot = dis->readByte();
19}
20
21void RotateHeadPacket::write(DataOutputStream *dos)
22{
23 dos->writeInt(id);
24 dos->writeByte(yHeadRot);
25}
26
27void RotateHeadPacket::handle(PacketListener *listener)
28{
29 listener->handleRotateMob(shared_from_this());
30}
31
32int RotateHeadPacket::getEstimatedSize()
33{
34 return 5;
35}
36
37bool RotateHeadPacket::canBeInvalidated()
38{
39 return true;
40}
41
42bool RotateHeadPacket::isInvalidatedBy(shared_ptr<Packet> packet)
43{
44 shared_ptr<RotateHeadPacket> target = dynamic_pointer_cast<RotateHeadPacket>(packet);
45 return target->id == id;
46}
47
48bool RotateHeadPacket::isAync()
49{
50 return true;
51}