}
if (!stack.stackTagCompound.hasKey("Inventory") || stack.stackTagCompound.getTagList("Inventory", stack.stackTagCompound.getId()).tagCount() <= 0) {
list.add(StringHelper.localize("info.cofh.empty"));
return;
}
NBTTagList nbtList = stack.stackTagCompound.getTagList("Inventory", stack.stackTagCompound.getId());
ItemStack curStack;
ItemStack curStack2;
ArrayList<ItemStack> containedItems = new ArrayList<ItemStack>();
boolean[] visited = new boolean[nbtList.tagCount()];
for (int i = 0; i < nbtList.tagCount(); i++) {
NBTTagCompound tag = nbtList.getCompoundTagAt(i);
int slot = tag.getInteger("Slot");
if (visited[i] || slot < minSlot || slot > maxSlot) {
continue;
}
visited[i] = true;
curStack = ItemStack.loadItemStackFromNBT(tag);
if (curStack == null) {
continue;
}
containedItems.add(curStack);
for (int j = 0; j < nbtList.tagCount(); j++) {
NBTTagCompound tag2 = nbtList.getCompoundTagAt(j);
int slot2 = tag.getInteger("Slot");
if (visited[j] || slot2 < minSlot || slot2 > maxSlot) {
continue;
}