"adding" to list on config?

Discussion in 'Plugin Development' started by CookCreeperz, Feb 6, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    CookCreeperz

    Ok so my hashmap:
    Code:
        public static HashMap<String, String> hashmap = new HashMap<String, String>();
    Gets put into config:
    Code:
                    hashmap.put(player.getName(), player.getName());
                    getConfig().set("Minez", hashmap.get(player.getName()));
                    saveConfig();
    But when multiple players get put in, the config just replaces, how do i make it go to the next line?
     
  2. Offline

    bob7

    Well, there are many ways to do this. The easyist?

    hashmap.put(player.getName(), player.getName());
    getConfig().set("Minez.playersnameHere", hashmap.get(player.getName()));
    saveConfig();


    Then to retrieve it, you could just do hashmap.put(bob7l, getconfig.getString("minez.bob7l")
     
  3. Offline

    CookCreeperz

    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page