use of binnie.genetics.genetics.GeneItem in project Binnie by ForestryMC.
the class ItemSerum method getSpeciesRoot.
@Override
public ISpeciesRoot getSpeciesRoot(ItemStack stack) {
GeneItem geneItem = this.getGeneItem(stack);
Preconditions.checkNotNull(geneItem, "Cannot get species root from itemStack that is not a valid serum.");
return geneItem.getSpeciesRoot();
}
use of binnie.genetics.genetics.GeneItem in project Binnie by ForestryMC.
the class ItemSerum method getSubItems.
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
if (this.isInCreativeTab(tab)) {
for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
Map<IChromosomeType, List<IAllele>> chromosomeMap = Binnie.GENETICS.getChromosomeMap(root);
if (chromosomeMap != null) {
for (Map.Entry<IChromosomeType, List<IAllele>> entry : chromosomeMap.entrySet()) {
IChromosomeType chromosome = entry.getKey();
for (final IAllele allele : entry.getValue()) {
Gene gene = Gene.create(allele, chromosome, root);
IGeneItem geneItem = new GeneItem(gene);
ItemStack stack = new ItemStack(this);
geneItem.writeToItem(stack);
items.add(stack);
}
}
}
}
}
}
use of binnie.genetics.genetics.GeneItem in project Binnie by ForestryMC.
the class ItemSerum method create.
public static ItemStack create(final IGene gene) {
final ItemStack item = new ItemStack(Genetics.items().itemSerum);
item.setItemDamage(item.getMaxDamage());
final GeneItem seq = new GeneItem(gene);
seq.writeToItem(item);
return item;
}
use of binnie.genetics.genetics.GeneItem in project Binnie by ForestryMC.
the class ItemSerum method getGenes.
@Override
public IGene[] getGenes(ItemStack stack) {
GeneItem geneItem = this.getGeneItem(stack);
Preconditions.checkNotNull(geneItem, "Cannot get genes from itemStack that is not a valid serum.");
return new IGene[] { geneItem.getGene() };
}
use of binnie.genetics.genetics.GeneItem in project Binnie by ForestryMC.
the class ItemSerum method getGene.
@Override
public IGene getGene(ItemStack stack, int chromosome) {
GeneItem geneItem = this.getGeneItem(stack);
Preconditions.checkNotNull(geneItem, "Cannot get gene from itemStack that is not a valid serum.");
return geneItem.getGene();
}
Aggregations