def write_packet(self, packet, force=False):
        if force:
            self._write_lock.acquire()
            if self.options.compression_enabled:
                packet.write(self.socket, self.options.compression_threshold)
            else:
                packet.write(self.socket)
            self._write_lock.release()
        else:
            self._outgoing_packet_queue.append(packet)
Writes a packet to the server.
dataset/ETHPy150Open ammaraskar/pyCraft/minecraft/networking/connection.py/Connection.write_packet