Update changelog

This commit is contained in:
Raoul Van den Berge
2016-06-04 00:54:40 +02:00
parent cfee0cabb6
commit 214742e08c
4 changed files with 18 additions and 20 deletions

View File

@@ -47,7 +47,9 @@ public abstract class NBTStorage implements IStorage {
stack.setTagCompound(tag.hasKey(NBT_ITEM_NBT) ? ((NBTTagCompound) tag.getTag(NBT_ITEM_NBT)) : null);
stacks.add(stack);
if (stack.getItem() != null) {
stacks.add(stack);
}
}
}

View File

@@ -46,7 +46,7 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
IDeepStorageUnit storageUnit = getStorageUnit();
if (storageUnit != null) {
if (storageUnit.getStoredItemType() != null) {
if (storageUnit.getStoredItemType() != null && storageUnit.getStoredItemType().getItem() != null) {
items.add(storageUnit.getStoredItemType().copy());
}
} else {
@@ -54,7 +54,7 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
if (handler != null) {
for (int i = 0; i < handler.getSlots(); ++i) {
if (handler.getStackInSlot(i) != null) {
if (handler.getStackInSlot(i) != null && handler.getStackInSlot(i).getItem() != null) {
items.add(handler.getStackInSlot(i).copy());
}
}

View File

@@ -335,26 +335,20 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
ItemStack stack = items.get(i);
// If the item doesn't exist anymore, remove it from storage to avoid crashes
if (stack.getItem() == null) {
combinedItems.add(stack);
combinedItemsIndices.add(i);
} else {
for (int j = i + 1; j < items.size(); ++j) {
if (combinedItemsIndices.contains(j)) {
continue;
}
for (int j = i + 1; j < items.size(); ++j) {
if (combinedItemsIndices.contains(j)) {
continue;
}
ItemStack otherStack = items.get(j);
ItemStack otherStack = items.get(j);
if (RefinedStorageUtils.compareStackNoQuantity(stack, otherStack)) {
// We copy here so we don't modify the quantity of the ItemStack IStorage uses.
// We re-get the ItemStack because the stack may change from a previous iteration in this loop
items.set(i, ItemHandlerHelper.copyStackWithSize(items.get(i), items.get(i).stackSize + otherStack.stackSize));
if (RefinedStorageUtils.compareStackNoQuantity(stack, otherStack)) {
// We copy here so we don't modify the quantity of the ItemStack IStorage uses.
// We re-get the ItemStack because the stack may change from a previous iteration in this loop
items.set(i, ItemHandlerHelper.copyStackWithSize(items.get(i), items.get(i).stackSize + otherStack.stackSize));
combinedItems.add(otherStack);
combinedItemsIndices.add(j);
}
combinedItems.add(otherStack);
combinedItemsIndices.add(j);
}
}
}