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 "PacketListener.h"
3#include "LevelParticlesPacket.h"
4
5LevelParticlesPacket::LevelParticlesPacket()
6{
7 this->name = L"";
8 this->x = 0.0f;
9 this->y = 0.0f;
10 this->z = 0.0f;
11 this->xDist = 0.0f;
12 this->yDist = 0.0f;
13 this->zDist = 0.0f;
14 this->maxSpeed = 0.0f;
15 this->count = 0;
16}
17
18LevelParticlesPacket::LevelParticlesPacket(const wstring &name, float x, float y, float z, float xDist, float yDist, float zDist, float maxSpeed, int count)
19{
20 this->name = name;
21 this->x = x;
22 this->y = y;
23 this->z = z;
24 this->xDist = xDist;
25 this->yDist = yDist;
26 this->zDist = zDist;
27 this->maxSpeed = maxSpeed;
28 this->count = count;
29}
30
31void LevelParticlesPacket::read(DataInputStream *dis)
32{
33 name = readUtf(dis, 64);
34 x = dis->readFloat();
35 y = dis->readFloat();
36 z = dis->readFloat();
37 xDist = dis->readFloat();
38 yDist = dis->readFloat();
39 zDist = dis->readFloat();
40 maxSpeed = dis->readFloat();
41 count = dis->readInt();
42}
43
44void LevelParticlesPacket::write(DataOutputStream *dos)
45{
46 writeUtf(name, dos);
47 dos->writeFloat(x);
48 dos->writeFloat(y);
49 dos->writeFloat(z);
50 dos->writeFloat(xDist);
51 dos->writeFloat(yDist);
52 dos->writeFloat(zDist);
53 dos->writeFloat(maxSpeed);
54 dos->writeInt(count);
55}
56
57wstring LevelParticlesPacket::getName()
58{
59 return name;
60}
61
62double LevelParticlesPacket::getX()
63{
64 return x;
65}
66
67double LevelParticlesPacket::getY()
68{
69 return y;
70}
71
72double LevelParticlesPacket::getZ()
73{
74 return z;
75}
76
77float LevelParticlesPacket::getXDist()
78{
79 return xDist;
80}
81
82float LevelParticlesPacket::getYDist()
83{
84 return yDist;
85}
86
87float LevelParticlesPacket::getZDist()
88{
89 return zDist;
90}
91
92float LevelParticlesPacket::getMaxSpeed()
93{
94 return maxSpeed;
95}
96
97int LevelParticlesPacket::getCount()
98{
99 return count;
100}
101
102void LevelParticlesPacket::handle(PacketListener *listener)
103{
104 listener->handleParticleEvent(shared_from_this());
105}
106
107int LevelParticlesPacket::getEstimatedSize()
108{
109 return 4 * 2 + 7 * 8;
110}