use of binnie.genetics.genetics.GeneArrayItem in project Binnie by ForestryMC.
the class ItemSerumArray method getSubItems.
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
if (this.isInCreativeTab(tab)) {
for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
for (IIndividual template : root.getIndividualTemplates()) {
if (template.getGenome().getPrimary().isSecret()) {
continue;
}
IGeneItem geneItem = new GeneArrayItem();
for (IChromosomeType type : root.getKaryotype()) {
IChromosome chromosome = template.getGenome().getChromosomes()[type.ordinal()];
if (chromosome != null) {
IAllele active = chromosome.getActiveAllele();
geneItem.addGene(new Gene(active, type, root));
}
}
ItemStack array = new ItemStack(this);
geneItem.writeToItem(array);
items.add(array);
}
}
}
}
use of binnie.genetics.genetics.GeneArrayItem in project Binnie by ForestryMC.
the class ItemSerumArray method create.
public static ItemStack create(final IGene gene) {
final ItemStack item = new ItemStack(Genetics.items().itemSerumArray);
item.setItemDamage(item.getMaxDamage());
final GeneArrayItem seq = new GeneArrayItem(gene);
seq.writeToItem(item);
return item;
}
Aggregations