Applied-Energistics-2-tiler.../util/item/OreReference.java

45 lines
902 B
Java
Raw Normal View History

package appeng.util.item;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import net.minecraft.item.ItemStack;
import appeng.api.storage.data.IAEItemStack;
2014-09-20 23:35:55 +02:00
public class OreReference
{
private LinkedList<ItemStack> otherOptions = new LinkedList();
private ArrayList aeotherOptions = null;
private HashSet<Integer> ores = new HashSet<Integer>();
2014-09-21 02:37:37 +02:00
public Collection<ItemStack> getEquivalents()
{
return otherOptions;
}
2014-09-21 02:37:37 +02:00
public List<IAEItemStack> getAEEquivalents()
{
if ( aeotherOptions == null )
{
aeotherOptions = new ArrayList( otherOptions.size() );
// SUMMON AE STACKS!
for (ItemStack is : otherOptions)
if ( is.getItem() != null )
aeotherOptions.add( AEItemStack.create( is ) );
}
return aeotherOptions;
}
public Collection<Integer> getOres()
{
return ores;
}
}