private void disconnect(Channel channel, String message) {
        if (channel.isActive() && this.currentProtocol == Protocol.PLAY || this.currentProtocol == Protocol.LOGIN) {

            ByteBuf header = Unpooled.buffer();
            ByteBuf data = Unpooled.buffer();

            ByteBufUtils.writeVarInt(data, 0x0);

            JSONObject json = new JSONObject();
            json.put("text", message);

            ByteBufUtils.writeUTF(data, json.toJSONString());

            ByteBufUtils.writeVarInt(header, data.readableBytes());

            sendPacket(channel, Unpooled.wrappedBuffer(header, data));

        } else {
            channel.close();
        }
    }