public static PhotoInformation getPhotoWithID(ItemStack stack, String photoID) { if (stack == null || !(stack.getItem() instanceof ItemPhotoStorage)) { return null; } CameraCraftItem.createStackTagCompound(stack); NBTTagList photos = stack.stackTagCompound.getTagList("photos"); for (int i = 0; i < photos.tagCount(); i++) { PhotoInformation info = PhotoInformation.createFromNBT(((NBTTagCompound) photos.tagAt(i))); if (info.getPhotoId().equals(photoID)) { return info; } } return null; }