Update changelog
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user