public static void load(int num) throws IOException {
		File f = new File(Util.getDataPath() + File.separator + "world" + num + ".jmp");
		if (!f.exists()) {
			System.out.println("Could not find file: " + f.getAbsolutePath());
			return;
		}

		FileInputStream fis = new FileInputStream(f);
		byte[] compressed = new byte[(int) f.length()];
		fis.read(compressed);
		fis.close();
		
		byte[] decompressed = null;
		try {
			decompressed = Util.decompress(compressed);
		} catch (DataFormatException e) {
			e.printStackTrace();
			Gui.addMessage("Failed to decompress bytes");
			return;
		}
		
		// Decompressed
		DataInputStream in = new DataInputStream(new ByteArrayInputStream(decompressed));
		int pre = in.readInt();
		if (pre != PREFIX) {
			System.out.println("Invalid World Prefix. Cancelling World Load Process!");
			in.close();
			return;
		}
		int ver = in.readShort();
		if (ver != WORLDSAVE_VERSION) {
			Gui.addMessage("Invalid World Version!");
			in.close();
			return;
		}
		int pX = in.readInt();
		int pY = in.readInt();
		int width = in.readInt();
		int height = in.readInt();
		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				byte id = (byte) in.readByte();
				Jomapat.game.getWorld().setBlock(x, y, id != (byte)0xFF ? BlockType.values()[id] : null);
			}
		}
		Jomapat.game.getWorld().finish();
		for(int i = 0; i < BlockType.values().length; i++) {
			int amount = in.readInt();
			Jomapat.game.getInventory().setBlockAmount(BlockType.values()[i], amount);
		}
		Jomapat.game.getPlayer().setX(pX);
		Jomapat.game.getPlayer().setY(pY);

		in.close();
		Gui.addMessage("World Loaded!");
	}