public static String inventoryToString(final Inventory inventory) {
		final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		final OutputStream dataOutput = new DataOutputStream(outputStream);
		try {
			final NBTTagList itemList = new NBTTagList();
			for (int i = 0; i < inventory.getSize(); i++) {
				final NBTTagCompound outputObject = new NBTTagCompound();
				Object craft = null;
				final CraftItemStack is = (CraftItemStack) inventory.getItem(i);
				if (is != null) {
					craft = getNMSCopy(is);
				} else {
					craft = null;
				}
				if (craft != null && class_ItemStack.isInstance(craft)) {
					outputObject.setByte("Slot", (byte) i);
					CraftItemStack.asNMSCopy(is).save(outputObject);
					itemList.add(outputObject);
				}
			}

			// This bit is kind of ugly and prone to break between versions
			// Well, moreso than the rest of this, even.
			NBTTagCompound tag = new NBTTagCompound();
			tag.set("Items", itemList);
			NBTCompressedStreamTools.a(tag, dataOutput);
		} catch (Throwable ex) {
			ex.printStackTrace();
		}

		return new BigInteger(1, outputStream.toByteArray()).toString(32);
	}