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 "AddPaintingPacket.h"
7
8
9
10AddPaintingPacket::AddPaintingPacket()
11{
12 id = -1;
13 x = 0;
14 y = 0;
15 z = 0;
16 dir = 0;
17 motive = L"";
18}
19
20AddPaintingPacket::AddPaintingPacket(shared_ptr<Painting> e)
21{
22 id = e->entityId;
23 x = e->xTile;
24 y = e->yTile;
25 z = e->zTile;
26 dir = e->dir;
27 motive = e->motive->name;
28}
29
30void AddPaintingPacket::read(DataInputStream *dis) //throws IOException
31{
32 id = dis->readInt();
33 motive = readUtf(dis, Painting::Motive::MAX_MOTIVE_NAME_LENGTH);
34 x = dis->readInt();
35 y = dis->readInt();
36 z = dis->readInt();
37 dir = dis->readInt();
38}
39
40void AddPaintingPacket::write(DataOutputStream *dos) //throws IOException
41{
42 dos->writeInt(id);
43 writeUtf(motive, dos);
44 dos->writeInt(x);
45 dos->writeInt(y);
46 dos->writeInt(z);
47 dos->writeInt(dir);
48}
49
50void AddPaintingPacket::handle(PacketListener *listener)
51{
52 listener->handleAddPainting(shared_from_this());
53}
54
55int AddPaintingPacket::getEstimatedSize()
56{
57 return 24;
58}