Solved Config in multi-file plugin? Help! [Please Read Me!]

Discussion in 'Plugin Development' started by Mindlessmink, Jul 27, 2016.

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

    Mindlessmink

    I'm making a Multi-Class plugin, a Mini essentials and I'm adding a config. I was just about to make a custom permissions denied message, So. I did:
    Code:
    } else {
                    sender.sendMessage(ChatColor.RED + getConfig().getString("Permissions Denied Message"));
                    return true;
                }
    But getConfig was giving me an error. I registered the config in the main class, and I don't know how to do it in Multi class. I'm pretty sure that code is correct. Please tell me how to register the config in my other classes. Thanks.

    ClearChat class: http://pastebin.com/aiM1iQbZ
    Main class: http://pastebin.com/sfJJdy4e
     
    Last edited: Jul 27, 2016
  2. Offline

    bwfcwalshy Retired Staff

    @Mindlessmink And this is why you should know Java before doing Bukkit.

    You need to pass the instance of Main through the constructor
     
  3. Offline

    Mindlessmink

    Okay thanks. :p Should I quit coding Bukkit ? :/
     
  4. Offline

    mine-care

    @Mindlessmink Not quit. You can always develop bukkit when you have the basic background of java. You can learn java in a relatively short period of time, good enough. Then, you can continue on developing for bukkit. But as a general rule starting from something simpler is always a good idea ;)
     
    bwfcwalshy likes this.
  5. Offline

    Mindlessmink

    Okay, Sorry late on reposting, But thanks for the advice.
     
  6. Offline

    mine-care

    @Mindlessmink No problem ;)
    P.s. Don't forget to tahg us by doing @<UserNameHere> as i did above ^
     
  7. @Mindlessmink always, always, always check the docs. Don't post till you read all the docs.
     
Thread Status:
Not open for further replies.

Share This Page