Fixed a crash when dealing with large ore dictionary registrations.

This commit is contained in:
AlgorithmX2
2014-08-11 22:56:57 -05:00
parent feb7d7be95
commit f3a9a12e04
3 changed files with 22 additions and 18 deletions
+16 -4
View File
@@ -1,8 +1,10 @@
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;
@@ -10,17 +12,27 @@ import appeng.api.storage.data.IAEItemStack;
public class OreRefrence
{
LinkedList<ItemStack> otherOptions = new LinkedList();
LinkedList<IAEItemStack> aeotherOptions = new LinkedList();
HashSet<Integer> ores = new HashSet<Integer>();
private LinkedList<ItemStack> otherOptions = new LinkedList();
private ArrayList aeotherOptions = null;
private HashSet<Integer> ores = new HashSet<Integer>();
public Collection<ItemStack> getEquivilients()
{
return otherOptions;
}
public Collection<IAEItemStack> getAEEquivilients()
public List<IAEItemStack> getAEEquivilients()
{
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;
}