summaryrefslogtreecommitdiffstats
path: root/src/Packet.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-18 17:13:01 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-18 17:13:01 +0200
commita2fe2786682e626dae25db2d375280c83b615796 (patch)
tree34bc8295ad75b967519959e6300aada5531e2345 /src/Packet.hpp
parent2017-08-17 (diff)
downloadAltCraft-a2fe2786682e626dae25db2d375280c83b615796.tar
AltCraft-a2fe2786682e626dae25db2d375280c83b615796.tar.gz
AltCraft-a2fe2786682e626dae25db2d375280c83b615796.tar.bz2
AltCraft-a2fe2786682e626dae25db2d375280c83b615796.tar.lz
AltCraft-a2fe2786682e626dae25db2d375280c83b615796.tar.xz
AltCraft-a2fe2786682e626dae25db2d375280c83b615796.tar.zst
AltCraft-a2fe2786682e626dae25db2d375280c83b615796.zip
Diffstat (limited to '')
-rw-r--r--src/Packet.hpp50
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