@SuppressWarnings("unchecked")
	public void loadPossibleTreasure() throws IOException, ClassNotFoundException
    {
    	FileInputStream fis = new FileInputStream(TreasureHunt.getInstance().getDataFolder() + "/numberOfTreasures.xml");
    	if(fis == null) return;
    	ObjectInputStream ois = new ObjectInputStream(fis);
    	if(ois == null) return;
    	numberOfTreasures = (int) ois.readObject();
    	ois.close();
    	
    	boolean done = false;
    	int j = -1;
    	TreasureChest chest = new TreasureChest();
    	
    	if(numberOfTreasures == 0)
    		return;
    	
    	for(int i = 0; i < numberOfTreasures; i++)
    	{
    		 while (done == false) {
                 j++;
                 //Checks if the config contains that slot
                 if (TreasureHunt.getInstance().getConfig().contains("PossibleTreasures."+i+"."+j)) {
                     //Adds the itemstack to the list
                	 chest.addLoot(TreasureHunt.getInstance().getConfig().getItemStack("PossibleTreasures."+i+"."+j));
                 } else {
                     //No more items, the list is complete
                     done = true;
                 }
             }
    		 addTreasureChest(chest);
    		 chest = new TreasureChest();
    		 done = false;
    		 j = -1;
    	}
    }