Files
GabsPuNs-Project_Zenith_Main/Minecraft.World/ContainerSetDataPacket.cpp
GabsPuNs bc6c09146a New File System and Cleanup some code Part 3
* Remove stdafx.h and some <unordered_set> includes
* Update Minecraft Server Defines and remove more unused folders/files
* Unbloat stdafx.h from Minecraft.World
2026-05-24 22:21:41 -04:00

45 lines
892 B
C++

#include <iostream>
#include "InputOutputStream.h"
#include "PacketListener.h"
#include "ContainerSetDataPacket.h"
ContainerSetDataPacket::ContainerSetDataPacket()
{
containerId = 0;
id = -1;
value = 0;
}
ContainerSetDataPacket::ContainerSetDataPacket(int containerId, int id, int value)
{
this->containerId = containerId;
this->id = id;
this->value = value;
}
void ContainerSetDataPacket::handle(PacketListener *listener)
{
listener->handleContainerSetData(shared_from_this());
}
void ContainerSetDataPacket::read(DataInputStream *dis) //throws IOException
{
containerId = dis->readByte();
id = dis->readShort();
value = dis->readShort();
}
void ContainerSetDataPacket::write(DataOutputStream *dos) // throws IOException
{
dos->writeByte(containerId);
dos->writeShort(id);
dos->writeShort(value);
}
int ContainerSetDataPacket::getEstimatedSize()
{
return 1 + 4;
}