Quick Questions

Discussion in 'Plugin Development' started by Niknea, Apr 26, 2014.

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

    Niknea

    Hey guys, I got a few questions

    1. So (hopefully) we all know how to get objects from the main class into another class, using something like this code.
    PHP:
    /*
    * IN MAIN CLASS
    */
    static Main plugin;
     
    /*
    * IN CLASS WE'RE GETTING OBJECTS FROM MAIN CLASS FROM
    */
    Main plugin;
    public 
    /*class name*/(Main plugin){
    this.plugin plugin;
    }
    Then we can access an object from the main class like
    PHP:
    plugin.//object
    So my question is, how can I access objects from other classes like how I do with the main class (not using non-stop statics.)

    2. For multiple packages, do all I have to do is create a new package and I'm set? Or do I have to do more? Ex. if my package is named "me.niknea.hi", to make an "eco" package I would just do "me.niknea.hi.eco". Would that work?

    Thanks,
    Niknea
     
  2. Offline

    Glumpz

    Niknea Yes that would work. When classes reference each other the packages don't affect it.
     
  3. Offline

    Niknea

    Glumpz Ok, what about question 1 ^_^
     
  4. Offline

    Glumpz

    Niknea The same exact way just instead of Main use the classes name.
     
Thread Status:
Not open for further replies.

Share This Page