[SOLVED] access server.properties content?

Discussion in 'Plugin Development' started by Evenprime, May 2, 2011.

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

    Evenprime

    Is there a builtin method to access the content of the server.properties file from within my plugin? Or will I have to open and read/parse the file myself? I couldn't find anything when looking through bukkits Server class that would fit what I want.

    I'm especially interested in reading the "allow-flight" setting to warn my users about potential conflicts with my plugin.
     
  2. Offline

    Acrobot

    Bukkit Configuration.
    public static Configuration yourConfig = new Configuration(new File("server.properties"));

    To read values, use
    Code:
    yourConfig.get<Type>,
    for example
    yourConfig.getBoolean("configuration name (for example allow-flight)", <default value if not found>);
    
     
  3. Offline

    Evenprime

    Thank you very much!
     
Thread Status:
Not open for further replies.

Share This Page