mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 12:33:35 +00:00
38 lines
912 B
C++
38 lines
912 B
C++
#pragma once
|
|
|
|
#include "Packet.h"
|
|
|
|
class CompoundTag;
|
|
|
|
class TileEntityDataPacket
|
|
: public Packet,
|
|
public std::enable_shared_from_this<TileEntityDataPacket> {
|
|
public:
|
|
static const int TYPE_MOB_SPAWNER = 1;
|
|
static const int TYPE_ADV_COMMAND = 2;
|
|
static const int TYPE_BEACON = 3;
|
|
static const int TYPE_SKULL = 4;
|
|
|
|
int x, y, z;
|
|
int type;
|
|
CompoundTag* tag;
|
|
|
|
private:
|
|
void _init();
|
|
|
|
public:
|
|
TileEntityDataPacket();
|
|
~TileEntityDataPacket();
|
|
TileEntityDataPacket(int x, int y, int z, int type, CompoundTag* tag);
|
|
|
|
virtual void read(DataInputStream* dis);
|
|
virtual void write(DataOutputStream* dos);
|
|
virtual void handle(PacketListener* listener);
|
|
virtual int getEstimatedSize();
|
|
|
|
public:
|
|
static std::shared_ptr<Packet> create() {
|
|
return std::shared_ptr<Packet>(new TileEntityDataPacket());
|
|
}
|
|
virtual int getId() { return 132; }
|
|
}; |