Can't find this null thing! Configuraion.save();

Discussion in 'Plugin Development' started by mangine, Sep 8, 2011.

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

    mangine

    Hi guys, hope someone can help me here, this thing is making me crazy:


    Code:
    portalsfile = new Configuration(new File(plugin.maindir+ File.separator+"portals.yml"));
            portalsfile.load();
            portalsfile.removeProperty("Portals");
            portalsfile.setProperty("Portals", save);
            portalsfile.save();
    
    where save is a NOT NULL ConfigurationNode.
    

    What is happening? I have the same code for another configuration file, but it works. (yeeeaahh the sameee! but with dif. nodes)
     
  2. save is configuration node?
     
  3. Offline

    mangine

    yes, and it's certainly not null. I'm tired by now, maybe tomorrow I'll check everything again but this is kind creepy.
     
  4. Just curious, why would you save a configuration node? Why not just save a String or something... I see no reason to save a node, nor have a node in the first place :O
     
  5. Offline

    mangine

    That's because I have a yml like this:
    Node:
    -Node2:
    - -prop1: value1

    if I setproperty("Node",var) where Var is a ConfigurationNode holding Node2 I suppose I'll have the same construction as above, at least worked for me before. It's just to make things easier to work with.


    - - - SUPER EDIT
    omg you just gave me an idea i love you, will test nao
     
  6. Offline

    mangine

    wow it worked, actually as I'm not using too many nodes it's easy to manage them to the file, so I removed the ConfigurationNode thing and worked now, thanks!
     
  7. Uhm, your welcome? :D
     
Thread Status:
Not open for further replies.

Share This Page