diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/ChunkVisibilityAreaPacket.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/ChunkVisibilityAreaPacket.h')
| -rw-r--r-- | Minecraft.World/ChunkVisibilityAreaPacket.h | 30 |
1 files changed, 30 insertions, 0 deletions
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<ChunkVisibilityAreaPacket> +{ +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<Packet> create() { return shared_ptr<Packet>(new ChunkVisibilityAreaPacket()); } + virtual int getId() { return 155; } +}; |
