File cant be null...

Discussion in 'Plugin Development' started by jkjames6, Feb 25, 2014.

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

    jkjames6

  2. Offline

    Traks

    Did you include the config.yml when building the .jar of your plugin? And is it called Config.yml or config.yml (might be of importance)?
     
  3. Offline

    jkjames6

    Yea i did :/
     
  4. Offline

    Alshain01

    That error isn't for your config, I think it's for plugin.yml.
     
  5. Offline

    jkjames6

  6. Offline

    Alshain01

    I'm wrong. I'm just having trouble finding your plugin in the error. Are you sure all files are in there? Take your .jar, rename it .zip open it and see if all the yml is there.
     
  7. Offline

    jkjames6

    Alshain01 I did just that and all the files are there and they open with the correct info inside
     
  8. Offline

    Alshain01

    Hmm, I'm still looking at it. I don't think this is your issue, but I did notice your not bracketing your reload handler. Might want to look at that.
     
  9. Offline

    jkjames6

  10. Offline

    Alshain01

    Well that was half the problem, but there is still this:

    Code:java
    1. if(sender.hasPermission("plugins.reload"))
    2. sender.sendMessage(rl);
    3. getConfig().options().copyDefaults(true);
    4. saveConfig();


    Your if statement only applies to the sendMessage(), the other two lines will always run. You probably don't want that.

    But that isn't your error, and I'm sorry to say I don't see what would cause such an error in the code.
     
  11. Offline

    jkjames6

    xD does anyone?
     
  12. Offline

    Alshain01

    Actually, what is the copyDefaults statement supposed to do?

    I'm thinking in onEnable you wanted saveDefaultConfig() and in the command you wanted reloadConfig()

    That may be your error.
     
  13. Offline

    Traks

    I tested your plugin and it didn't throw any errors for me...
     
  14. Offline

    jkjames6

    Really?
    Ill try it again...
     
  15. Offline

    Sagacious_Zed Bukkit Docs

    It depends on what version of craftbukkit you are running. Plugin initialization was shifted fairly recently. Before the shift, your plugin was initialized much later, and thus methods like getConfig do not function.

    jkjames6 you are invoking JavaPlugin methods before your plugin is initialized.
     
Thread Status:
Not open for further replies.

Share This Page