@Override public void registerAllele(IAllele allele, IChromosomeType... chromosomeTypes) { addValidAlleleTypes(allele, chromosomeTypes); alleleMap.put(allele.getUID(), allele); if (allele instanceof IAlleleSpecies) { IClassification branch = ((IAlleleSpecies) allele).getBranch(); branch.addMemberSpecies((IAlleleSpecies) allele); } for (IAlleleHandler handler : this.alleleHandlers) { handler.onRegisterAllele(allele); } }
FlowerDefinition(String name, String branch, String binomial, IFlowerType<EnumFlowerType> flowerType, boolean isDominant, EnumFlowerColor primaryColor, EnumFlowerColor secondaryColor) { String modId = Constants.BOTANY_MOD_ID; String uid = modId + ".flower" + this; String unlocalizedDescription = "botany.description.flower" + this; String unlocalizedName = "botany.flowers.species." + name; variantTemplates = new ArrayList<>(); this.name = name; this.binomial = binomial; branchName = branch; type = flowerType; this.primaryColor = primaryColor; this.secondaryColor = secondaryColor; IAlleleFlowerSpeciesBuilder speciesBuilder = BotanyAPI.flowerFactory.createSpecies(modId, uid, unlocalizedName, "Binnie's Mod Team", unlocalizedDescription, isDominant, getBranch(), binomial, flowerType); setSpeciesProperties(speciesBuilder); species = speciesBuilder.build(); if (this.branch != null) { this.branch.addMemberSpecies(species); } }
public void preInit() { final String scientific = StringUtils.capitalize(branchName); final String uid = "trees." + branchName; branch = AlleleManager.alleleRegistry.getClassification("genus." + uid); if (branch == null) { branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific); } IAlleleTreeSpeciesBuilder speciesBuilder = TreeManager.treeFactory.createSpecies(getUID(), String.format(unlocalizedName, getUID()), getAuthority(), String.format(unlocalizedDesc, getUID()), isDominant(), branch, getBinomial(), Constants.EXTRA_TREES_MOD_ID, leafSpriteProvider, saplingType.getGermlingModelProvider(leafColor, woodColor), woodProvider, this, new ETLeafProvider() ); setSpeciesProperties(speciesBuilder); species = speciesBuilder.build(); branch.addMemberSpecies(species); }