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 "PacketListener.h"
5#include "SetSpawnPositionPacket.h"
6
7
8
9SetSpawnPositionPacket::SetSpawnPositionPacket()
10{
11 x = 0;
12 y = 0;
13 z = 0;
14}
15
16SetSpawnPositionPacket::SetSpawnPositionPacket(int x, int y, int z)
17{
18 this->x = x;
19 this->y = y;
20 this->z = z;
21}
22
23void SetSpawnPositionPacket::read(DataInputStream *dis) //throws IOException
24{
25 x = dis->readInt();
26 y = dis->readInt();
27 z = dis->readInt();
28}
29
30void SetSpawnPositionPacket::write(DataOutputStream *dos) //throws IOException
31{
32 dos->writeInt(x);
33 dos->writeInt(y);
34 dos->writeInt(z);
35}
36
37void SetSpawnPositionPacket::handle(PacketListener *listener)
38{
39 listener->handleSetSpawn(shared_from_this());
40}
41
42int SetSpawnPositionPacket::getEstimatedSize()
43{
44 return 3*4;
45}
46
47bool SetSpawnPositionPacket::canBeInvalidated()
48{
49 return true;
50}
51
52bool SetSpawnPositionPacket::isInvalidatedBy(shared_ptr<Packet> packet)
53{
54 return true;
55}
56
57bool SetSpawnPositionPacket::isAync()
58{
59 return false;
60}