Solved Config Help

Discussion in 'Plugin Development' started by webbhead, Apr 10, 2015.

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

    webbhead

    What I would like to know is how I can get a configuration section from the config that is configurable by the user so:
    Code:
    warps:
      shop:
        slot: 1
        item: DIAMOND
        name: '&a&lShop'
        lore:
          - '&b&lBuy and Sell some goodies!'
          - '&a&lSHOP'
        warp: shop
    The "shop" section is just default. When the plugin is finished I want them to be able to basically copy that whole section and paste it and change everything so the config would look like:
    Code:
    warps:
      shop:
        slot: 1
        item: DIAMOND
        name: '&a&lShop'
        lore:
          - '&b&lBuy and Sell some goodies!'
          - '&a&lSHOP'
        warp: shop
      warp2:
        *All configuration under this sub section*
     
  2. Offline

    caderape

    @webbhead
    You can get back infos with a loops of configurationsection("warps.shop")
    then set to a new one like "warps.pvp" for example.

    for (String s : getconfig().getconfigurationsection("warps.shop").getkeys(false)) {
    getconfig().set("warps.pvp."+s, getconfig().getString("warps.shop."+s));
    }
     
  3. Offline

    webbhead

    What I want to do is where they can add their own I don't want to add them straight from the code... And what is getKeys(false) I know it is for HashMaps (I am pretty sure don't really use Hashmaps..) just wondering.
     
  4. Offline

    caderape

    @webbhead Well sorry, but english is not my main language, so i guess i dun really understand what you want exactly.
     
  5. Offline

    webbhead

    Anyone know how to do this?
     
  6. Offline

    webbhead

    Bump I still really need help on this.
     
  7. Offline

    GODofCRAFTERS

    So you want to be able to create multiple config strings as the user creates a warp or whatever? And you want them to display what the user enters?
     
Thread Status:
Not open for further replies.

Share This Page