public static void load()//Method that loads inventory from file
	{
		String input="savedata/"+JokemonDriver.getVersion()+".inventory";

		try
		{
			BufferedReader in = new BufferedReader(new FileReader(input));
			String test=in.readLine();

			int runs=Integer.parseInt(in.readLine());

			for (int i = 0; i<runs; i++)
			{
				Item.Type itemType=Item.Type.valueOf(in.readLine());

				if(itemType==Item.Type.TM||itemType==Item.Type.HM)
				{
					int itemNum=Integer.parseInt(in.readLine());
					int tmNo=Integer.parseInt(in.readLine());
					Inventory.addItem(new Item(itemType,(long)itemNum,tmNo));
				}
				else
				{
					int itemNum=Integer.parseInt(in.readLine());
					Inventory.addItem(new Item(itemType,(long)itemNum));
				}

				System.out.println(""+itemType+" added to inventory");
			}
			money=Integer.parseInt(in.readLine());
		}
		catch(Exception ignored){}

		JokemonDriver.testEncryption(input);

		System.out.println("Inventory loaded successfully.");
	}