Esempio n. 1
0
 def write_fields(self, packet_buffer):
     Float.send(self.x, packet_buffer)
     Float.send(self.y, packet_buffer)
     Float.send(self.z, packet_buffer)
     Float.send(self.radius, packet_buffer)
     Integer.send(len(self.records), packet_buffer)
     for record in self.records:
         Byte.send(record.x, packet_buffer)
         Byte.send(record.y, packet_buffer)
         Byte.send(record.z, packet_buffer)
     Float.send(self.player_motion_x, packet_buffer)
     Float.send(self.player_motion_y, packet_buffer)
     Float.send(self.player_motion_z, packet_buffer)
Esempio n. 2
0
 def write_fields(self, packet_buffer):
     Float.send(self.x, packet_buffer)
     Float.send(self.y, packet_buffer)
     Float.send(self.z, packet_buffer)
     Float.send(self.radius, packet_buffer)
     Integer.send(len(self.records), packet_buffer)
     for record in self.records:
         Byte.send(record.x, packet_buffer)
         Byte.send(record.y, packet_buffer)
         Byte.send(record.z, packet_buffer)
     Float.send(self.player_motion_x, packet_buffer)
     Float.send(self.player_motion_y, packet_buffer)
     Float.send(self.player_motion_z, packet_buffer)
Esempio n. 3
0
    def write_fields(self, packet_buffer):
        VarInt.send(self.entity_id, packet_buffer)
        if self.context.protocol_version >= 49:
            UUID.send(self.object_uuid, packet_buffer)
        Byte.send(self.type_id, packet_buffer)

        xyz_type = Double if self.context.protocol_version >= 100 else Integer
        for coord in self.x, self.y, self.z:
            xyz_type.send(coord, packet_buffer)
        for coord in self.pitch, self.yaw:
            UnsignedByte.send(coord, packet_buffer)

        Integer.send(self.data, packet_buffer)
        if self.context.protocol_version >= 49 or self.data > 0:
            for coord in self.velocity_x, self.velocity_y, self.velocity_z:
                Short.send(coord, packet_buffer)
Esempio n. 4
0
    def write_fields(self, packet_buffer):
        VarInt.send(self.entity_id, packet_buffer)
        if self.context.protocol_version >= 49:
            UUID.send(self.object_uuid, packet_buffer)

        if self.context.protocol_version >= 458:
            VarInt.send(self.type_id, packet_buffer)
        else:
            Byte.send(self.type_id, packet_buffer)

        xyz_type = Double if self.context.protocol_version >= 100 else Integer
        for coord in self.x, self.y, self.z:
            xyz_type.send(coord, packet_buffer)
        for coord in self.pitch, self.yaw:
            UnsignedByte.send(coord, packet_buffer)

        Integer.send(self.data, packet_buffer)
        if self.context.protocol_version >= 49 or self.data > 0:
            for coord in self.velocity_x, self.velocity_y, self.velocity_z:
                Short.send(coord, packet_buffer)
Esempio n. 5
0
    def write_fields(self, packet_buffer):
        VarInt.send(self.entity_id, packet_buffer)
        if self.context.protocol_later_eq(49):
            UUID.send(self.object_uuid, packet_buffer)

        if self.context.protocol_later_eq(458):
            VarInt.send(self.type_id, packet_buffer)
        else:
            Byte.send(self.type_id, packet_buffer)

        # pylint: disable=no-member
        xyz_type = Double if self.context.protocol_later_eq(100) else Integer
        for coord in self.x, self.y, self.z:
            xyz_type.send(coord, packet_buffer)
        for coord in self.pitch, self.yaw:
            Angle.send(coord, packet_buffer)

        Integer.send(self.data, packet_buffer)
        if self.context.protocol_later_eq(49) or self.data > 0:
            for coord in self.velocity_x, self.velocity_y, self.velocity_z:
                Short.send(coord, packet_buffer)
Esempio n. 6
0
 def write_fields(self, packet_buffer):
     Integer.send(self.x, packet_buffer)
     Integer.send(self.z, packet_buffer)
     Boolean.send(self.full_chunk, packet_buffer)
     VarInt.send(self.bit_mask_y, packet_buffer)
     Nbt.send(self.heightmaps, packet_buffer)
     if self.full_chunk:
         for i in range(1024):
             Integer.send(self.biomes[i], packet_buffer)
     VarInt.send(len(self.data), packet_buffer)
     packet_buffer.send(self.data)
     VarInt.send(len(self.entities), packet_buffer)
     for e in self.entities:
         Nbt.send(e, packet_buffer)
Esempio n. 7
0
 def write(self, packet_buffer):
     VarInt.send(self.player_id, packet_buffer)
     Integer.send(self.entity_id, packet_buffer)
     String.send(self.message, packet_buffer)
Esempio n. 8
0
 def write(self, packet_buffer):
     VarInt.send(self.duration, packet_buffer)
     Integer.send(self.entity_id, packet_buffer)
Esempio n. 9
0
 def send(cls, value, socket):
     for coordinate in value:
         Integer.send(int(coordinate * 8), socket)
Esempio n. 10
0
 def write_fields(self, packet_buffer):
     Integer.send(self.chunk_x, packet_buffer)
     Integer.send(self.chunk_z, packet_buffer)
     VarInt.send(len(self.records), packet_buffer)
     for record in self.records:
         record.write(packet_buffer)
Esempio n. 11
0
 def write(self, packet_buffer):
     VarInt.send(self.player_id, packet_buffer)
     Integer.send(self.entity_id, packet_buffer)
     String.send(self.message, packet_buffer)
Esempio n. 12
0
 def write(self, packet_buffer):
     VarInt.send(self.duration, packet_buffer)
     Integer.send(self.entity_id, packet_buffer)