Exemplo n.º 1
0
        public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
        {
            ChunkX = stream.ReadInt32();
            ChunkZ = stream.ReadInt32();
            RecordCount = stream.ReadVarInt();
            Records = new BlockChangeRecord[RecordCount];

            for (int i = 0; i < RecordCount; i++) {
                Records[i] = new BlockChangeRecord();
                Records[i].HorizonalPosition = stream.ReadUInt8();
                Records[i].Y = stream.ReadUInt8();
                Records[i].BlockId = stream.ReadVarInt();
            }

            return mode;
        }
Exemplo n.º 2
0
 public MultipleBlockChangePacket(int chunkX, int chunkZ, int recordCount, BlockChangeRecord[] records)
 {
     // TODO: Make this packet a little nicer
     ChunkX = chunkX;
     ChunkZ = chunkZ;
     RecordCount = recordCount;
     Records = records;
 }