If the item doesn't exist anymore, remove it from storage to avoid crashes
This commit is contained in:
@@ -186,17 +186,22 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
|
|
||||||
ItemGroup group = itemGroups.get(i);
|
ItemGroup group = itemGroups.get(i);
|
||||||
|
|
||||||
for (int j = i + 1; j < itemGroups.size(); ++j) {
|
// If the item doesn't exist anymore, remove it from storage to avoid crashes
|
||||||
if (markedIndexes.contains(j)) {
|
if (group.getType() == null) {
|
||||||
continue;
|
markedIndexes.add(i);
|
||||||
}
|
} else {
|
||||||
|
for (int j = i + 1; j < itemGroups.size(); ++j) {
|
||||||
|
if (markedIndexes.contains(j)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ItemGroup otherGroup = itemGroups.get(j);
|
ItemGroup otherGroup = itemGroups.get(j);
|
||||||
|
|
||||||
if (group.compareNoQuantity(otherGroup)) {
|
if (group.compareNoQuantity(otherGroup)) {
|
||||||
group.setQuantity(group.getQuantity() + otherGroup.getQuantity());
|
group.setQuantity(group.getQuantity() + otherGroup.getQuantity());
|
||||||
|
|
||||||
markedIndexes.add(j);
|
markedIndexes.add(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user