Having troubles with instances

Discussion in 'Plugin Development' started by TerroDoor, Dec 8, 2019.

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

    TerroDoor

    Okay so i have classes with methods inside that I need to access inside other classes. I don’t want to make these static so how can I make an instance of these classes and register it to main?

    Previously I was using static methods and putting a “new <classname>” instance in my onEnable


    Sent from my iPhone using Tapatalk
     
  2. Online

    timtower Moderator Moderator

    @TerroDoor Put fields in the main class.
    Make getters for them.
     
  3. Offline

    TerroDoor

    Thanks I’ll study into this, I need to practise with my constructors/getters/setters


    Sent from my iPhone using Tapatalk
     
Thread Status:
Not open for further replies.

Share This Page