Solved getConfig() not working outside of main class

Discussion in 'Plugin Development' started by ItsMas_, Jan 10, 2016.

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

    ItsMas_

    The getConfig() method is only working in my Main class. When I try to use it outside of the Main class, the error is: "The method getConfig() is undefined for the type pms"

    Any help? Thanks
     
  2. Online

    timtower Administrator Administrator Moderator

    @ItsMas_ Constructor, pass the main instance to the other classes, then use plugin.getConfig()
     
  3. Offline

    ItsMas_

    Wow! That was a quick response. How do I pass the main instance to the other classes? this is my first project using multiple classes.
     
  4. Online

    timtower Administrator Administrator Moderator

  5. Offline

    ItsMas_

  6. Online

    timtower Administrator Administrator Moderator

    Won't help further with it though. I find this basic Java.
     
  7. Offline

    Lolmewn

    And it is.

    OP: Please read up on how to use classes & what they are, how to pass objects around (hint: constructor), and how to access functions in other classes.
     
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page