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.item.h"
5#include "PacketListener.h"
6#include "CraftItemPacket.h"
7
8
9
10CraftItemPacket::~CraftItemPacket()
11{
12}
13
14CraftItemPacket::CraftItemPacket()
15{
16 recipe = -1;
17 uid = 0;
18}
19
20CraftItemPacket::CraftItemPacket(int recipe, short uid)
21{
22 this->recipe = recipe;
23 this->uid = uid;
24}
25
26void CraftItemPacket::handle(PacketListener *listener)
27{
28 listener->handleCraftItem(shared_from_this());
29}
30
31void CraftItemPacket::read(DataInputStream *dis) //throws IOException
32{
33 uid = dis->readShort();
34 recipe = dis->readInt();
35}
36
37void CraftItemPacket::write(DataOutputStream *dos) // throws IOException
38{
39 dos->writeShort(uid);
40 dos->writeInt(recipe);
41}
42
43int CraftItemPacket::getEstimatedSize()
44{
45 return 2 + 4;
46}