Config is resetting

Discussion in 'Plugin Development' started by Baummann, Nov 2, 2011.

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

    Baummann

    I'm trying to store a LinkedHashMap in a config file using this code:

    Code:java
    1. public LinkedHashMap<String, Double> prices = new LinkedHashMap<String, Double>();


    and this when loading the config:

    Code:java
    1. prices = (LinkedHashMap<String, Double>)config.getProperty("setrankpb.iConomy.prices");
    2. if (prices == null) {
    3. prices = new LinkedHashMap<String, Double>();
    4. prices.put("exampleRank", 3.0);
    5. config.setProperty("SetRankPB.iConomy.prices", prices);
    6. }

    The problem is, the plugin always thinks that my map is equal to null and resets the property. I don't have any errors in the console, it's only resetting, nothing else.

    Fixed it. The property was misspelt.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 21, 2016
  2. Offline

    Windwaker

    lawl ^^
     
Thread Status:
Not open for further replies.

Share This Page