Applied-Energistics-2-tiler.../core/features/registries/SpecialComparisonRegistry.java
2014-09-20 22:27:56 +02:00

41 lines
926 B
Java

package appeng.core.features.registries;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import appeng.api.features.IItemComparisonProvider;
import appeng.api.features.IItemComparison;
import appeng.api.features.ISpecialComparisonRegistry;
public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
{
private List<IItemComparisonProvider> CompRegistry;
public SpecialComparisonRegistry() {
CompRegistry = new ArrayList<IItemComparisonProvider>();
}
@Override
public IItemComparison getSpecialComparion(ItemStack stack)
{
for (IItemComparisonProvider i : CompRegistry)
{
IItemComparison comp = i.getComparison( stack );
if ( comp != null )
{
return comp;
}
}
return null;
}
@Override
public void addComparisonProvider(IItemComparisonProvider prov)
{
CompRegistry.add( prov );
}
}