@Override
    public void serialize(Buffer buf) {
        short flag1 = 0;
        flag1 = BooleanByteWrapper.setFlag(flag1, 0, sex);
        flag1 = BooleanByteWrapper.setFlag(flag1, 1, isRideable);
        flag1 = BooleanByteWrapper.setFlag(flag1, 2, isWild);
        flag1 = BooleanByteWrapper.setFlag(flag1, 3, isFecondationReady);
        buf.writeUByte(flag1);
        buf.writeDouble(id);
        buf.writeInt(model);
        buf.writeUShort(ancestor.length);
        for (int entry : ancestor) {
            buf.writeInt(entry);
        }
        buf.writeUShort(behaviors.length);
        for (int entry : behaviors) {
            buf.writeInt(entry);
        }
        buf.writeString(name);
        buf.writeInt(ownerId);
        buf.writeDouble(experience);
        buf.writeDouble(experienceForLevel);
        buf.writeDouble(experienceForNextLevel);
        buf.writeByte(level);
        buf.writeInt(maxPods);
        buf.writeInt(stamina);
        buf.writeInt(staminaMax);
        buf.writeInt(maturity);
        buf.writeInt(maturityForAdult);
        buf.writeInt(energy);
        buf.writeInt(energyMax);
        buf.writeInt(serenity);
        buf.writeInt(aggressivityMax);
        buf.writeInt(serenityMax);
        buf.writeInt(love);
        buf.writeInt(loveMax);
        buf.writeInt(fecondationTime);
        buf.writeInt(boostLimiter);
        buf.writeDouble(boostMax);
        buf.writeInt(reproductionCount);
        buf.writeInt(reproductionCountMax);
        buf.writeUShort(effectList.length);
        for (ObjectEffectInteger entry : effectList) {
            entry.serialize(buf);
        }
    }