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 "net.minecraft.network.packet.h"
3#include "TileDestructionPacket.h"
4
5TileDestructionPacket::TileDestructionPacket()
6{
7 id = 0;
8 x = 0;
9 y = 0;
10 z = 0;
11 state = 0;
12}
13
14TileDestructionPacket::TileDestructionPacket(int id, int x, int y, int z, int state)
15{
16 this->id = id;
17 this->x = x;
18 this->y = y;
19 this->z = z;
20 this->state = state;
21}
22
23void TileDestructionPacket::read(DataInputStream *dis)
24{
25 id = dis->readInt();
26 x = dis->readInt();
27 y = dis->readInt();
28 z = dis->readInt();
29 state = dis->readUnsignedByte();
30}
31
32void TileDestructionPacket::write(DataOutputStream *dos)
33{
34 dos->writeInt(id);
35 dos->writeInt(x);
36 dos->writeInt(y);
37 dos->writeInt(z);
38 dos->write(state);
39}
40
41void TileDestructionPacket::handle(PacketListener *listener)
42{
43 listener->handleTileDestruction(shared_from_this());
44}
45
46int TileDestructionPacket::getEstimatedSize()
47{
48 return 13;
49}
50
51int TileDestructionPacket::getEntityId()
52{
53 return id;
54}
55
56int TileDestructionPacket::getX()
57{
58 return x;
59}
60
61int TileDestructionPacket::getY()
62{
63 return y;
64}
65
66int TileDestructionPacket::getZ()
67{
68 return z;
69}
70
71int TileDestructionPacket::getState()
72{
73 return state;
74}
75
76bool TileDestructionPacket::canBeInvalidated()
77{
78 return true;
79}
80
81bool TileDestructionPacket::isInvalidatedBy(shared_ptr<Packet> packet)
82{
83 shared_ptr<TileDestructionPacket> target = dynamic_pointer_cast<TileDestructionPacket>(packet);
84 return target->id == id;
85}