Applied-Energistics-2-tiler.../integration/modules/helpers/ForestryGeneticsProvider.java
2013-12-27 16:59:59 -06:00

32 lines
907 B
Java

package appeng.integration.modules.helpers;
import net.minecraft.item.ItemStack;
import appeng.api.features.IItemComparisionProvider;
import appeng.api.features.IItemComparison;
import forestry.api.genetics.IIndividual;
public class ForestryGeneticsProvider implements IItemComparisionProvider
{
@Override
public IItemComparison getComparison(ItemStack is)
{
if ( forestry.api.genetics.AlleleManager.alleleRegistry != null )
{
IIndividual idiv = forestry.api.genetics.AlleleManager.alleleRegistry.getIndividual( is );
if ( idiv == null )
return null;
return new ForestryGeneticsComparison( idiv );
}
return null;
}
@Override
public boolean canHandle(ItemStack stack)
{
if ( forestry.api.genetics.AlleleManager.alleleRegistry != null )
return forestry.api.genetics.AlleleManager.alleleRegistry.isIndividual( stack );
return false;
}
}