mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 11:33:36 +00:00
39 lines
1,009 B
C++
39 lines
1,009 B
C++
#pragma once
|
|
|
|
#include <format>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "Packet.h"
|
|
#include "minecraft/network/packet/Packet.h"
|
|
#include "minecraft/world/entity/SyncedEntityData.h"
|
|
|
|
class SetEntityDataPacket
|
|
: public Packet,
|
|
public std::enable_shared_from_this<SetEntityDataPacket> {
|
|
public:
|
|
int id;
|
|
|
|
private:
|
|
std::vector<std::shared_ptr<SynchedEntityData::DataItem> >* packedItems;
|
|
|
|
public:
|
|
SetEntityDataPacket();
|
|
~SetEntityDataPacket();
|
|
SetEntityDataPacket(int id, std::shared_ptr<SynchedEntityData>,
|
|
bool notJustDirty);
|
|
|
|
virtual void read(DataInputStream* dis);
|
|
virtual void write(DataOutputStream* dos);
|
|
virtual void handle(PacketListener* listener);
|
|
virtual int getEstimatedSize();
|
|
|
|
std::vector<std::shared_ptr<SynchedEntityData::DataItem> >*
|
|
getUnpackedData();
|
|
|
|
public:
|
|
static std::shared_ptr<Packet> create() {
|
|
return std::make_shared<SetEntityDataPacket>();
|
|
}
|
|
virtual int getId() { return 40; }
|
|
}; |