Use a list instead of map. Unfortunately not O(1) anymore, but I have no choice due to flags.

This commit is contained in:
Raoul Van den Berge
2016-05-19 11:25:34 +02:00
parent daca12e1cb
commit b473a2f3b9
4 changed files with 141 additions and 223 deletions

View File

@@ -338,7 +338,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
}
// If the item doesn't exist anymore, remove it from storage to avoid crashes
if (group.getMeta().getType() == null) {
if (group.getType() == null) {
combinedGroups.add(i);
} else {
for (int j = i + 1; j < itemGroups.size(); ++j) {
@@ -679,8 +679,8 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
// NO OP, the quantity already set (64) is needed for shift
}
if (quantity > group.getMeta().getType().getItemStackLimit(group.toStack())) {
quantity = group.getMeta().getType().getItemStackLimit(group.toStack());
if (quantity > group.getType().getItemStackLimit(group.toStack())) {
quantity = group.getType().getItemStackLimit(group.toStack());
}
ItemStack took = take(group.copy(quantity).toStack());