Certain YAML Config Nodes Return Null

Discussion in 'Plugin Development' started by quaz3l, Feb 17, 2012.

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

    quaz3l

    When I define a config node like this:
    PHP:
    if(this.getConfig().getString("d.tasks.0.itemDisplay") == null)
                    
    this.getConfig().set("d.tasks.0.itemDisplay""Diamond");
    And I confirm it to be in the config like this:
    Code:
    d:
      tasks:
        '0':
          itemDisplay: Diamond
    When I try to get the node's value back like this:
    Code:
    this.getConfig().getString("d.tasks.0.itemDisplay");
    It returns null, but if I switch the node to
    Code:
    d:
      tasks:
        i:
          itemDisplay: Diamond
    And try to get it with the code:
    PHP:
    this.getConfig().getString("d.tasks.i.itemDisplay");
    It returns "Diamond". How can I get it to always return diamond even if it is defined in the yaml as:
    Code:
    d:
      tasks:
        '0':
          itemDisplay: Diamond
     
  2. Offline

    Sagacious_Zed Bukkit Docs

    It's very possible that it cannot take strings with just numbers for keys. You can try filing this as a bug on leaky.
     
  3. Offline

    quaz3l

    Sagacious_Zed
    Sorry I was using a different build of Bukkit that was very old I replaced it with the new version and it works now.
     
Thread Status:
Not open for further replies.

Share This Page