public NBT(byte[] data) throws IllegalArgumentException
	{
		byte[] uncompressed;
		try
		{
			GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(data));
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			int res = 0;
			byte buf[] = new byte[1024];
			while (res >= 0) {
			    res = in.read(buf, 0, buf.length);
			    if (res > 0) {
			        out.write(buf, 0, res);
			    }
			}
			uncompressed = out.toByteArray();
		}
		catch (IOException e)
		{
			System.err.println("WARNING: GZIP failed, assuming uncompressed!");
			uncompressed = data;
		}
		ByteArrayInputStream s = new ByteArrayInputStream(uncompressed);
		if(s.read() != 10)
			throw new IllegalArgumentException("Invalid NBT data!");
		mainTag = new NBTCompound(s, true);
		if(s.available() > 0)
			System.err.println("WARNING: Data parse ended before end of file!");
	}