mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 12:23:36 +00:00
37 lines
867 B
C++
37 lines
867 B
C++
#include "../../Platform/stdafx.h"
|
|
#include <iostream>
|
|
#include "../../IO/Streams/InputOutputStream.h"
|
|
#include "../../Headers/net.minecraft.world.item.h"
|
|
#include "PacketListener.h"
|
|
#include "CraftItemPacket.h"
|
|
|
|
CraftItemPacket::~CraftItemPacket() {}
|
|
|
|
CraftItemPacket::CraftItemPacket() {
|
|
recipe = -1;
|
|
uid = 0;
|
|
}
|
|
|
|
CraftItemPacket::CraftItemPacket(int recipe, short uid) {
|
|
this->recipe = recipe;
|
|
this->uid = uid;
|
|
}
|
|
|
|
void CraftItemPacket::handle(PacketListener* listener) {
|
|
listener->handleCraftItem(shared_from_this());
|
|
}
|
|
|
|
void CraftItemPacket::read(DataInputStream* dis) // throws IOException
|
|
{
|
|
uid = dis->readShort();
|
|
recipe = dis->readInt();
|
|
}
|
|
|
|
void CraftItemPacket::write(DataOutputStream* dos) // throws IOException
|
|
{
|
|
dos->writeShort(uid);
|
|
dos->writeInt(recipe);
|
|
}
|
|
|
|
int CraftItemPacket::getEstimatedSize() { return 2 + 4; }
|