From a2fe2786682e626dae25db2d375280c83b615796 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 18 Aug 2017 20:13:01 +0500 Subject: 2017-08-18 --- src/Packet.hpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src/Packet.hpp') diff --git a/src/Packet.hpp b/src/Packet.hpp index c499720..6318eab 100644 --- a/src/Packet.hpp +++ b/src/Packet.hpp @@ -751,4 +751,54 @@ struct PacketSpawnMob : Packet { unsigned char Yaw, Pitch, HeadPitch; short VelocityX, VelocityY, VelocityZ; //Metadata +}; + +struct PacketBlockChange : Packet { + void ToStream(StreamOutput *stream) override { + + } + + void FromStream(StreamInput *stream) override { + Position = stream->ReadPosition(); + BlockId = stream->ReadVarInt(); + } + + int GetPacketId() override { + return PacketNamePlayCB::BlockChange; + } + + Vector Position; + int BlockId; +}; + +struct PacketMultiBlockChange : Packet { + void ToStream(StreamOutput *stream) override { + + } + + void FromStream(StreamInput *stream) override { + ChunkX = stream->ReadInt(); + ChunkZ = stream->ReadInt(); + int recordCount = stream->ReadVarInt(); + for (int i = 0; i < recordCount; i++) { + Record record; + record.HorizontalPosition = stream->ReadUByte(); + record.YCoordinate = stream->ReadUByte(); + record.BlockId = stream->ReadVarInt(); + Records.push_back(record); + } + } + + int GetPacketId() override { + return PacketNamePlayCB::MultiBlockChange; + } + + int ChunkX; + int ChunkZ; + struct Record { + unsigned char HorizontalPosition; + unsigned char YCoordinate; + int BlockId; + }; + std::vector Records; }; \ No newline at end of file -- cgit v1.2.3