public IPacket ReadPacket(IMinecraftDataReader reader)
        {
            Coordinates = Coordinates2D.FromReaderInt(reader);
            RecordList = RecordList.FromReader(reader);

            return this;
        }
Exemplo n.º 2
0
        public static RecordList FromReader(IMinecraftDataReader reader)
        {
            var value = new RecordList();

            var count = reader.ReadVarInt();

            for (int i = 0; i < count; i++)
            {
                var record = new Record();

                var coordinates = reader.ReadShort();
                var y           = coordinates & 0xFF;
                var z           = (coordinates >> 8) & 0xf;
                var x           = (coordinates >> 12) & 0xf;

                record.BlockIDMeta = reader.ReadVarInt();
                record.Coordinates = new Position(x, y, z);

                value[i] = record;
            }

            return(value);
        }
Exemplo n.º 3
0
        public static RecordList FromReader(IMinecraftDataReader reader)
        {
            var value = new RecordList();

            var count = reader.ReadVarInt();

            for (int i = 0; i < count; i++)
            {
                var record = new Record();

                var coordinates = reader.ReadShort();
                var y = coordinates & 0xFF;
                var z = (coordinates >> 8) & 0xf; 
                var x = (coordinates >> 12) & 0xf;

                record.BlockIDMeta = reader.ReadVarInt();
                record.Coordinates = new Position(x, y, z);

                value[i] = record;
            }

            return value;
        }