package mariculture.fishery.fish.dna;

import mariculture.api.fishery.fish.FishDNA;
import mariculture.api.fishery.fish.FishSpecies;
import mariculture.core.config.FishMechanics.FussyFish;
import net.minecraft.item.ItemStack;

public class FishDNATemperatureTolerance extends FishDNA {
    @Override
    public Integer getDNAFromSpecies(FishSpecies species) {
        return Math.max(0, species.getTemperatureTolerance());
    }
    
    @Override
    public int getCopyChance() {
        return 35;
    }
    
    public Integer sanitize(Integer i) {
        return Math.min(100, Math.max(0, i));
    }

    @Override
    public Integer getDNA(ItemStack stack) {
        return sanitize(super.getDNA(stack) + FussyFish.SALINITY_TOLERANCE_BOOSTER);
    }

    @Override
    public Integer getLowerDNA(ItemStack stack) {
        return sanitize(super.getLowerDNA(stack) + FussyFish.SALINITY_TOLERANCE_BOOSTER);
    }
}

package mariculture.fishery.fish.dna;

import mariculture.api.fishery.fish.FishDNA;
import mariculture.api.fishery.fish.FishSpecies;
import mariculture.core.config.FishMechanics.FussyFish;
import net.minecraft.item.ItemStack;

public class FishDNATemperatureTolerance extends FishDNA {
    @Override
    public Integer getDNAFromSpecies(FishSpecies species) {
        return Math.max(0, species.getTemperatureTolerance());
    }
    
    @Override
    public int getCopyChance() {
        return 35;
    }
    
    public Integer sanitize(Integer i) {
        return Math.min(100, Math.max(0, i));
    }

    @Override
    public Integer getDNA(ItemStack stack) {
        return sanitize(super.getDNA(stack) + FussyFish.TEMP_TOLERANCE_BOOSTER);
    }

    @Override
    public Integer getLowerDNA(ItemStack stack) {
        return sanitize(super.getLowerDNA(stack) + FussyFish.TEMP_TOLERANCE_BOOSTER);
    }
}

Fix temperature using salinity config