mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-26 11:16:08 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -4,45 +4,39 @@
|
||||
#include "PacketListener.h"
|
||||
#include "ContainerOpenPacket.h"
|
||||
|
||||
ContainerOpenPacket::ContainerOpenPacket()
|
||||
{
|
||||
containerId = 0;
|
||||
type = 0;
|
||||
title = 0;
|
||||
size = 0;
|
||||
ContainerOpenPacket::ContainerOpenPacket() {
|
||||
containerId = 0;
|
||||
type = 0;
|
||||
title = 0;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
ContainerOpenPacket::ContainerOpenPacket(int containerId, int type, int title, int size)
|
||||
{
|
||||
this->containerId = containerId;
|
||||
this->type = type;
|
||||
this->title = title;
|
||||
this->size = size;
|
||||
ContainerOpenPacket::ContainerOpenPacket(int containerId, int type, int title,
|
||||
int size) {
|
||||
this->containerId = containerId;
|
||||
this->type = type;
|
||||
this->title = title;
|
||||
this->size = size;
|
||||
}
|
||||
|
||||
void ContainerOpenPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleContainerOpen(shared_from_this());
|
||||
void ContainerOpenPacket::handle(PacketListener* listener) {
|
||||
listener->handleContainerOpen(shared_from_this());
|
||||
}
|
||||
|
||||
|
||||
void ContainerOpenPacket::read(DataInputStream *dis) //throws IOException
|
||||
void ContainerOpenPacket::read(DataInputStream* dis) // throws IOException
|
||||
{
|
||||
containerId = (int)(dis->readByte() & (uint8_t)0xff);
|
||||
type = (int)(dis->readByte() & (uint8_t)0xff);
|
||||
title = dis->readShort();
|
||||
size = (int)(dis->readByte() & (uint8_t)0xff);
|
||||
containerId = (int)(dis->readByte() & (uint8_t)0xff);
|
||||
type = (int)(dis->readByte() & (uint8_t)0xff);
|
||||
title = dis->readShort();
|
||||
size = (int)(dis->readByte() & (uint8_t)0xff);
|
||||
}
|
||||
|
||||
void ContainerOpenPacket::write(DataOutputStream *dos) //throws IOException
|
||||
void ContainerOpenPacket::write(DataOutputStream* dos) // throws IOException
|
||||
{
|
||||
dos->writeByte((uint8_t)containerId & (uint8_t)0xff);
|
||||
dos->writeByte((uint8_t)type & (uint8_t)0xff);
|
||||
dos->writeShort(title & 0xffff);
|
||||
dos->writeByte((uint8_t)size & (uint8_t)0xff);
|
||||
dos->writeByte((uint8_t)containerId & (uint8_t)0xff);
|
||||
dos->writeByte((uint8_t)type & (uint8_t)0xff);
|
||||
dos->writeShort(title & 0xffff);
|
||||
dos->writeByte((uint8_t)size & (uint8_t)0xff);
|
||||
}
|
||||
|
||||
int ContainerOpenPacket::getEstimatedSize()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
int ContainerOpenPacket::getEstimatedSize() { return 5; }
|
||||
|
||||
Reference in New Issue
Block a user