mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 07:23:41 +00:00
31 lines
868 B
C++
31 lines
868 B
C++
#include "SetCarriedItemPacket.h"
|
|
|
|
#include "PacketListener.h"
|
|
#include "java/InputOutputStream/DataInputStream.h"
|
|
#include "java/InputOutputStream/DataOutputStream.h"
|
|
|
|
SetCarriedItemPacket::SetCarriedItemPacket() { slot = 0; }
|
|
|
|
SetCarriedItemPacket::SetCarriedItemPacket(int slot) { this->slot = slot; }
|
|
|
|
void SetCarriedItemPacket::read(DataInputStream* dis) // throws IOException
|
|
{
|
|
slot = dis->readShort();
|
|
}
|
|
|
|
void SetCarriedItemPacket::write(DataOutputStream* dos) // throws IOException
|
|
{
|
|
dos->writeShort(slot);
|
|
}
|
|
|
|
void SetCarriedItemPacket::handle(PacketListener* listener) {
|
|
listener->handleSetCarriedItem(shared_from_this());
|
|
}
|
|
|
|
int SetCarriedItemPacket::getEstimatedSize() { return 2; }
|
|
|
|
bool SetCarriedItemPacket::canBeInvalidated() { return true; }
|
|
|
|
bool SetCarriedItemPacket::isInvalidatedBy(std::shared_ptr<Packet> packet) {
|
|
return true;
|
|
} |