YAML + org.bukkit.util.comfig

Discussion in 'Plugin Development' started by wallnuss, Feb 12, 2011.

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

    wallnuss

    Hey there,

    I'm on the edge of a mental breakdown, because of YAML ...
    Ok what I'm trying to do is to read a config file with the following content:
    Code:
    
    worlds : {
        world : ["C:\\dev\\bukkit\\","C:\\dev\\"]
        nether : ["C:\\"]
        }
    
    and to import it :

    Code:
    config = new Configuration(new File(teclp.CONFIGURATION_FILE) );
            config.load();
            Map<String,ConfigurationNode> world_nodes = config.getNodes("worlds");
            if(world_nodes==null){
                System.out.println("YAML error");
            }else{
                System.out.println("Size of map:" +world_nodes.size());
                System.out.println("Object of map:" +world_nodes.toString());
                System.out.println("Values of map:" +world_nodes.values());
                System.out.println(world_nodes.get("world"));
            }
    I'm able to import a top level node but I can't import a yaml map. I already triple checked that it is really corrected yaml code.

    getNodes returns a map of the size zero...

    I just read that org.bukkit.util.config is not fully functionally. Is there any configuration engine for bukkit that works or do I need to write my own ?

    thanks in advance
     
  2. Offline

    Mixcoatl

    I could be wrong, but I'm not certain you need the curly braces. The plug-in YML configuration file does not used them in spite of reducing nested nodes to a type of Map<String, Object>. Consider the commands node, for example.
     
  3. Offline

    croxis

    yaml does not use curly braces. it should be:
    Code:
    worlds :
      world :
        - "C:\\dev\\bukkit\\"
        - "C:\\dev\\"
      nether :
        - "C:\\"
    
     
Thread Status:
Not open for further replies.

Share This Page