the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include <iostream>
3#include "InputOutputStream.h"
4#include "net.minecraft.world.entity.h"
5#include "PacketListener.h"
6#include "EntityActionAtPositionPacket.h"
7
8
9
10const int EntityActionAtPositionPacket::START_SLEEP = 0;
11
12EntityActionAtPositionPacket::EntityActionAtPositionPacket()
13{
14 id = -1;
15 x = 0;
16 y = 0;
17 z = 0;
18 action = 0;
19}
20
21EntityActionAtPositionPacket::EntityActionAtPositionPacket(shared_ptr<Entity> e, int action, int x, int y, int z)
22{
23 this->action = action;
24 this->x = x;
25 this->y = y;
26 this->z = z;
27 id = e->entityId;
28}
29
30void EntityActionAtPositionPacket::read(DataInputStream *dis) //throws IOException
31{
32 id = dis->readInt();
33 action = dis->readByte();
34 x = dis->readInt();
35 y = dis->readByte();
36 z = dis->readInt();
37}
38
39void EntityActionAtPositionPacket::write(DataOutputStream *dos) //throws IOException
40{
41 dos->writeInt(id);
42 dos->writeByte(action);
43 dos->writeInt(x);
44 dos->writeByte(y);
45 dos->writeInt(z);
46}
47
48void EntityActionAtPositionPacket::handle(PacketListener *listener)
49{
50 listener->handleEntityActionAtPosition(shared_from_this());
51}
52
53int EntityActionAtPositionPacket::getEstimatedSize()
54{
55 return 14;
56}