the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2using namespace std;
3
4#include "Packet.h"
5
6class CustomPayloadPacket : public Packet, public enable_shared_from_this<CustomPayloadPacket>
7{
8public:
9
10 // Mojang-defined custom packets
11 static const wstring CUSTOM_BOOK_PACKET;
12 static const wstring CUSTOM_BOOK_SIGN_PACKET;
13 static const wstring TEXTURE_PACK_PACKET;
14 static const wstring TRADER_LIST_PACKET;
15 static const wstring TRADER_SELECTION_PACKET;
16 static const wstring SET_ADVENTURE_COMMAND_PACKET;
17 static const wstring SET_BEACON_PACKET;
18 static const wstring SET_ITEM_NAME_PACKET;
19
20 wstring identifier;
21 int length;
22 byteArray data;
23
24 CustomPayloadPacket();
25 CustomPayloadPacket(const wstring &identifier, byteArray data);
26
27 virtual void read(DataInputStream *dis);
28 virtual void write(DataOutputStream *dos);
29 virtual void handle(PacketListener *listener);
30 virtual int getEstimatedSize();
31
32public:
33 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new CustomPayloadPacket()); }
34 virtual int getId() { return 250; }
35};