Search in sources :

Example 1 with IAllele

use of forestry.api.genetics.IAllele in project LogisticsPipes by RS485.

the class ForestryProxy method getIconIndexForAlleleId.

/**
	 * Used to get an icon index for a given allele.
	 * 
	 * @param uid
	 *            The uid String of the allele to get icon index for.
	 * @param phase
	 *            special phase of the bee.
	 */
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconIndexForAlleleId(String uid, int phase) {
    IAllele bSpecies = forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid);
    if (!(bSpecies instanceof IAlleleBeeSpecies)) {
        bSpecies = root.getDefaultTemplate()[forestry.api.apiculture.EnumBeeChromosome.SPECIES.ordinal()];
    }
    IAlleleBeeSpecies species = (IAlleleBeeSpecies) bSpecies;
    return species.getIcon(EnumBeeType.DRONE, phase);
}
Also used : IAllele(forestry.api.genetics.IAllele) IAlleleBeeSpecies(forestry.api.apiculture.IAlleleBeeSpecies) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 2 with IAllele

use of forestry.api.genetics.IAllele in project Railcraft by Railcraft.

the class ItemFilterBeeGenome method addInformation.

@Optional.Method(modid = ForestryPlugin.FORESTRY_ID)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> info, boolean adv) {
    super.addInformation(stack, player, info, adv);
    try {
        BeeFilter beeFilter = getBeeFilter(stack);
        if (beeFilter != null) {
            info.add(tr("item.railcraft.filter.bee.genome.tips.type", tr(translateType(beeFilter.type))));
            info.add(tr("item.railcraft.filter.bee.genome.tips.chromosome", tr(translateChromosome(beeFilter.chromosome))));
            String active;
            if (beeFilter.active != null) {
                IAllele allele = beeFilter.getActiveChromosome(beeFilter.active);
                if (allele != null)
                    active = StringUtils.capitalize(allele.getName());
                else
                    active = wildcard();
            } else
                active = wildcard();
            info.add(tr("item.railcraft.filter.bee.genome.tips.active", active));
            String inactive;
            if (beeFilter.inactive != null) {
                IAllele allele = beeFilter.getInactiveChromosome(beeFilter.inactive);
                if (allele != null)
                    inactive = StringUtils.capitalize(allele.getName());
                else
                    inactive = wildcard();
            } else
                inactive = wildcard();
            info.add(tr("item.railcraft.filter.bee.genome.tips.inactive", inactive));
        }
    } catch (Throwable throwable) {
        Game.logErrorAPI(Mod.FORESTRY.modId, throwable, BeeManager.class);
    }
}
Also used : IAllele(forestry.api.genetics.IAllele) BeeManager(forestry.api.apiculture.BeeManager)

Aggregations

IAllele (forestry.api.genetics.IAllele)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 BeeManager (forestry.api.apiculture.BeeManager)1 IAlleleBeeSpecies (forestry.api.apiculture.IAlleleBeeSpecies)1