mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 12:13:51 +00:00
Initial commit
This commit is contained in:
parent
def8cb4153
commit
b691c43c44
19437 changed files with 4363922 additions and 0 deletions
45
Minecraft.World/ContainerSetDataPacket.cpp
Normal file
45
Minecraft.World/ContainerSetDataPacket.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#include "stdafx.h"
|
||||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue