Storing & Loading HashMap

Discussion in 'Plugin Development' started by Pezah, Sep 27, 2013.

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

    Pezah

    Hello, I would like to be able to store this HashMap onEnable(), and be able to load it onDisable();

    Preferably through .txt, as I don't have a database and haven't dealt with configs before.

    Code:java
    1. public static HashMap<String, Integer> balance = new HashMap<String, Integer>();


    Not quite sure how to do this so if someone could show me that'd be great. :)
     
  2. Offline

    bigbeno37

    Wait...load it in onDisable() and store it in onEnable()?
     
  3. Offline

    Mathias Eklund

    To be able to load and store a hashmap you need to make two methods. One to save it and one to load it.
     
  4. Offline

    SuperOmegaCow

    bigbeno37 what he said, why would you save when the plugin is starting up then load the data when the plugin is stopping?
     
Thread Status:
Not open for further replies.

Share This Page