示例#1
0
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            Id = packet.ReadVarInt();
            //this.uuid = arg.readUuid();
            //this.entityTypeId = (EntityType)Registry.ENTITY_TYPE.get(arg.readVarInt());
            var x = packet.ReadDouble();
            var y = packet.ReadDouble();
            var z = packet.ReadDouble();

            Position = new Vector3(Convert.ToSingle(x), Convert.ToSingle(y), Convert.ToSingle(z));

            var pitch = packet.ReadByte();
            var yaw   = packet.ReadByte();

            Look = new Vector2(pitch, yaw);

            EntityData = packet.ReadVarInt();

            var velocityX = packet.ReadInt16();
            var velocityY = packet.ReadInt16();
            var velocityZ = packet.ReadInt16();

            Velocity = new Vector3(velocityX, velocityY, velocityZ);

            return(state);
        }
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            ServerId = packet.ReadString();
            var pkLength = packet.ReadInt16();

            PublicKey = packet.ReadUInt8Array(pkLength);
            var vtLength = packet.ReadInt16();

            VerificationToken = packet.ReadUInt8Array(vtLength);
            return(state);
        }