mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 08:33:41 +00:00
34 lines
849 B
C++
34 lines
849 B
C++
#include "TakeItemEntityPacket.h"
|
|
|
|
#include "PacketListener.h"
|
|
#include "java/InputOutputStream/DataInputStream.h"
|
|
#include "java/InputOutputStream/DataOutputStream.h"
|
|
|
|
TakeItemEntityPacket::TakeItemEntityPacket() {
|
|
itemId = -1;
|
|
playerId = -1;
|
|
}
|
|
|
|
TakeItemEntityPacket::TakeItemEntityPacket(int itemId, int playerId) {
|
|
this->itemId = itemId;
|
|
this->playerId = playerId;
|
|
}
|
|
|
|
void TakeItemEntityPacket::read(DataInputStream* dis) // throws IOException
|
|
{
|
|
itemId = dis->readInt();
|
|
playerId = dis->readInt();
|
|
}
|
|
|
|
void TakeItemEntityPacket::write(DataOutputStream* dos) // throws IOException
|
|
{
|
|
dos->writeInt(itemId);
|
|
dos->writeInt(playerId);
|
|
}
|
|
|
|
void TakeItemEntityPacket::handle(PacketListener* listener) {
|
|
listener->handleTakeItemEntity(shared_from_this());
|
|
}
|
|
|
|
int TakeItemEntityPacket::getEstimatedSize() { return 8; }
|