use internal stack for the oredict list

This commit is contained in:
way2muchnoise
2016-10-28 19:17:32 +02:00
parent e2d3047ddb
commit 38131305ce

View File

@@ -35,9 +35,10 @@ public class OreDictedItemStackList implements IItemStackList {
@Override
public void add(ItemStack stack) {
underlyingList.add(stack);
if (underlyingList.get(stack).stackSize == stack.stackSize) {
for (int id : OreDictionary.getOreIDs(stack)) {
stacks.put(id, stack);
ItemStack internalStack = underlyingList.get(stack);
if (internalStack != null && internalStack.stackSize == stack.stackSize) {
for (int id : OreDictionary.getOreIDs(internalStack)) {
stacks.put(id, internalStack);
}
}
}