diff options
Diffstat (limited to '')
-rw-r--r-- | src/Packet.hpp | 50 |
1 files changed, 50 insertions, 0 deletions
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<Record> Records; };
\ No newline at end of file |