Solved getConfig error

Discussion in 'Plugin Development' started by Laekh, Mar 24, 2013.

Thread Status:
Not open for further replies.
  1. Hello!

    I ran into a small problem,
    and have been unable to fix it for the past few hours.

    I've set up the getConfig here

    Code:
    public FileConfiguration getConfig() {
                 return p.getConfig();
     }
    
    the p is from

    Code:
    private static Plugin p;
    
    the file it's in is called Settings, and works with an instance.

    Code:
    private static Settings instance = new Settings();
     
    public static Settings getInstance(){
        return instance;
    }
    
    I call it using something like this:

    Code:
    if (!Settings.getInstance().getConfig().getBoolean("thisistrue"))
           return;
    
    Does anyone know why it creates an error refering to

    Code:
    public FileConfiguration getConfig() {
                 return p.getConfig();
     }
    
    when I run it?

    Thank you.
     
  2. Offline

    MylesIsCool

    Is it possible for you to post the full code, or PM it so it's easier to understand and solve your problem?
     

  3. There are 143 files x)
     
  4. Offline

    MylesIsCool

    Well i'm not sure what's up with your code, from the look of things it looks fine.
     
  5. mayby its smarter to test your code whle building, so you dont see the error after 100 files, also, where is the code where the p field gets its value?
     
  6. I fixed it myself, thanks though.

    In my setup for the instance I had to declare another fileconfig so I could assign the appropiate plugin p to it.
     
Thread Status:
Not open for further replies.

Share This Page