Solved Referring to another class doesn't work properly

Discussion in 'Plugin Development' started by FletchTech90, Jun 18, 2014.

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

    FletchTech90

    When I try to use something like
    Code:java
    1. Main.this.getResource("file.yml")
    , (and yes, I do need to use the this method thingy.) it doesn't quite work. It gives me an error within Eclipse:
    please help! This is urgent for one of my plugins!
     
  2. Offline

    coasterman10

    This is not the correct way to reference other classes. What you should do is use dependency injection to give the instance of your second class the instance of your main class. A quick google for dependency injection will show you how to do this.
     
  3. Offline

    FletchTech90

Thread Status:
Not open for further replies.

Share This Page