Solved Read config

Discussion in 'Plugin Development' started by MadeOke, Mar 11, 2013.

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

    MadeOke

    Helo, i just want to know a way to use wildcard on config path (*)

    Code:
    User1:
      '1234':
        type: a
        multi: 1
        amount: 2
    User3:
      '7765':
        type: z
        multi: 8
        amount: 1
    User2:
      '46421':
        type: c
        multi: 3
        amount: 8
    
    so i need to get the number part path (1234,7765,46421)
    i can't use "*."+num :(
    can i use regex?
     
  2. Offline

    RainoBoy97

    Use a for loop
     
    MadeOke likes this.
  3. Offline

    MadeOke

    um how to loop it?
     
  4. Offline

    willeb96

    PHP:
    for (String key getConfig().getKeys(false)) {
      
    System.out.writeln(key);
    }
     
    // or
    for (String key getConfig().getConfigurationSection("path.to.something").getKeys(false)) {
      
    System.out.writeln(key);
    }
     
    MadeOke likes this.
  5. Offline

    MadeOke

    w
    wow nice one
    thankyou very much
     
Thread Status:
Not open for further replies.

Share This Page