mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-25 09:47:24 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -4,62 +4,48 @@
|
||||
#include "PacketListener.h"
|
||||
#include "TileEntityDataPacket.h"
|
||||
|
||||
|
||||
|
||||
void TileEntityDataPacket::_init()
|
||||
{
|
||||
x = y = z = 0;
|
||||
type = TYPE_MOB_SPAWNER;
|
||||
tag = NULL;
|
||||
void TileEntityDataPacket::_init() {
|
||||
x = y = z = 0;
|
||||
type = TYPE_MOB_SPAWNER;
|
||||
tag = NULL;
|
||||
}
|
||||
|
||||
|
||||
TileEntityDataPacket::TileEntityDataPacket()
|
||||
{
|
||||
_init();
|
||||
shouldDelay = true;
|
||||
TileEntityDataPacket::TileEntityDataPacket() {
|
||||
_init();
|
||||
shouldDelay = true;
|
||||
}
|
||||
|
||||
TileEntityDataPacket::TileEntityDataPacket(int x, int y, int z, int type, CompoundTag *tag)
|
||||
{
|
||||
_init();
|
||||
shouldDelay = true;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
this->type = type;
|
||||
this->tag = tag;
|
||||
TileEntityDataPacket::TileEntityDataPacket(int x, int y, int z, int type,
|
||||
CompoundTag* tag) {
|
||||
_init();
|
||||
shouldDelay = true;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
this->type = type;
|
||||
this->tag = tag;
|
||||
}
|
||||
|
||||
TileEntityDataPacket::~TileEntityDataPacket()
|
||||
{
|
||||
delete tag;
|
||||
TileEntityDataPacket::~TileEntityDataPacket() { delete tag; }
|
||||
|
||||
void TileEntityDataPacket::read(DataInputStream* dis) {
|
||||
x = dis->readInt();
|
||||
y = dis->readShort();
|
||||
z = dis->readInt();
|
||||
type = dis->readByte();
|
||||
tag = readNbt(dis);
|
||||
}
|
||||
|
||||
void TileEntityDataPacket::read(DataInputStream *dis)
|
||||
{
|
||||
x = dis->readInt();
|
||||
y = dis->readShort();
|
||||
z = dis->readInt();
|
||||
type = dis->readByte();
|
||||
tag = readNbt(dis);
|
||||
void TileEntityDataPacket::write(DataOutputStream* dos) {
|
||||
dos->writeInt(x);
|
||||
dos->writeShort(y);
|
||||
dos->writeInt(z);
|
||||
dos->writeByte((uint8_t)type);
|
||||
writeNbt(tag, dos);
|
||||
}
|
||||
|
||||
void TileEntityDataPacket::write(DataOutputStream *dos)
|
||||
{
|
||||
dos->writeInt(x);
|
||||
dos->writeShort(y);
|
||||
dos->writeInt(z);
|
||||
dos->writeByte((uint8_t) type);
|
||||
writeNbt(tag, dos);
|
||||
void TileEntityDataPacket::handle(PacketListener* listener) {
|
||||
listener->handleTileEntityData(shared_from_this());
|
||||
}
|
||||
|
||||
void TileEntityDataPacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleTileEntityData(shared_from_this());
|
||||
}
|
||||
|
||||
int TileEntityDataPacket::getEstimatedSize()
|
||||
{
|
||||
return 6 * 4 + 1;
|
||||
}
|
||||
int TileEntityDataPacket::getEstimatedSize() { return 6 * 4 + 1; }
|
||||
Reference in New Issue
Block a user