From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/ChunkVisibilityAreaPacket.h | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Minecraft.World/ChunkVisibilityAreaPacket.h (limited to 'Minecraft.World/ChunkVisibilityAreaPacket.h') diff --git a/Minecraft.World/ChunkVisibilityAreaPacket.h b/Minecraft.World/ChunkVisibilityAreaPacket.h new file mode 100644 index 00000000..33087497 --- /dev/null +++ b/Minecraft.World/ChunkVisibilityAreaPacket.h @@ -0,0 +1,30 @@ +#pragma once +using namespace std; + +#include "Packet.h" + +class Level; + +// 4J Added this packet so that when a player initially joins the game we just need to send them the area of chunks +// around them rather than one packet for each chunk +class ChunkVisibilityAreaPacket : public Packet, public enable_shared_from_this +{ +public: + int m_minX, m_maxX, m_minZ, m_maxZ; + +private: + //int size; + +public: + ChunkVisibilityAreaPacket(); + ChunkVisibilityAreaPacket(int minX, int maxX, int minZ, int maxZ); + + virtual void read(DataInputStream *dis); + virtual void write(DataOutputStream *dos); + virtual void handle(PacketListener *listener); + virtual int getEstimatedSize(); + +public: + static shared_ptr create() { return shared_ptr(new ChunkVisibilityAreaPacket()); } + virtual int getId() { return 155; } +}; -- cgit v1.2.3