Solved First attempt with config files

Discussion in 'Plugin Development' started by klosjaarrr, Oct 9, 2014.

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

    klosjaarrr

    Hey all,

    I started my first attempt at using a configuration file today. My plugin let's players choose a title (prefix in chat) based on a predefined list in the configfile. However, my problem is the nodes in the configuration file are not static, and look like:

    Code:
    Titles:
      Default:
        - Default
        - AnotherTitle
      Staff:
        - Mod
        - Admin
    To 'loop' throught all the subnodes, I use getConfig().getConfigurationSection("Titles").getKeys(false);. Now my question is, how should I implement this method? What does this return, I suppose it is something like an array or HashMap with a list of nodes as Strings, but I'm not really sure about this. Could someone help me maybe? :)

    Think I got it! Thanks for reading anyway!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
Thread Status:
Not open for further replies.

Share This Page