Files
MinecraftConsoles/Minecraft.World/UseItemPacket.h
void_17 7074f35e4b shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
2026-03-02 15:58:20 +07:00

37 lines
917 B
C++

#pragma once
using namespace std;
#include "Packet.h"
class UseItemPacket : public Packet, public enable_shared_from_this<UseItemPacket>
{
private:
static const float CLICK_ACCURACY;
int x, y, z, face;
std::shared_ptr<ItemInstance> item;
float clickX, clickY, clickZ;
public:
UseItemPacket();
UseItemPacket(int x, int y, int z, int face, std::shared_ptr<ItemInstance> item, float clickX, float clickY, float clickZ);
~UseItemPacket();
virtual void read(DataInputStream *dis);
virtual void write(DataOutputStream *dos);
virtual void handle(PacketListener *listener);
virtual int getEstimatedSize();
int getX();
int getY();
int getZ();
int getFace();
std::shared_ptr<ItemInstance> getItem();
float getClickX();
float getClickY();
float getClickZ();
public:
static std::shared_ptr<Packet> create() { return std::shared_ptr<Packet>(new UseItemPacket()); }
virtual int getId() { return 15; }
};