public void save ()
      {
        try
          {
            synchronized (slotsMutex)
              {
                for (int i = 0; i < slots.length; i++)
                  {
                    Spell spell = slots[i];
                    if (spell == null)
                      {
                        properties.setProperty("slot" + i, "null");
                      }
                    else
                      {
                        properties.setProperty("slot" + i, spell.toString());
                      }
                  }
              }
            for (Entry<Spell.Type, Integer> entry : levels.entrySet())
              {
                properties.setProperty(entry.getKey().toString(), entry
                    .getValue().toString());
              }
            for (Entry<Spell.Type, Integer> entry : levelExp.entrySet())
              {
                properties.setProperty(entry.getKey().toString() + "-EXP",
                    entry.getValue().toString());
              }
            file.getParentFile().mkdirs();
            properties.store(new FileOutputStream(file), null);
          }
        catch (IOException e)
          {
            e.printStackTrace();
          }
      }