Solved Getting configs from other classes

Discussion in 'Plugin Development' started by Nibbit, Dec 19, 2015.

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

    Nibbit

    Hello!
    I recently started coding again... And I had a question :p I completely messed up something and I don't know how I could get it to work... I have 1 Main class ,1 CommandExcecutioner ,1 Listener and 1 Method class that isn't a Listener or CommandExcecutioner
    I got the CommandExcecutioner to work but then it broke again :p Here are my classes :

    SOLVED
     
    Last edited: Dec 19, 2015
  2. Offline

    Nibbit

    I know there are a lot! xD I completely gave up because I didn't even know what I was doing anymore :p I will remove all the crap and then try it again xD But I just wanted to know how can I get the config in an other class :p
     
  3. Offline

    Zombie_Striker

    @Nibbit
    Either pass the Main class (which should not be called Main), through the other classes constructor or pass the config instance through the constructor.
     
  4. Offline

    Nibbit

    *Facepalm* I need to sleep more... I figured it out xD In main class : (classpvpevents.plugin = this;)
    Other class : (publicstatic Plugin plugin;)
     
Thread Status:
Not open for further replies.

Share This Page