Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Known, May 23, 2017.
I am using a settings manager class, and wondering how i can access the config from every class.
You have to get an instance from the main class to the class you want.
You can create a singleton instance of that class, then it will be accessible from anywhere.
Here is an example of a singleton instance.
I always pass reference to the Main class through the constructors
of all classes and then leave the object I need reference to in the
main, but a singleton works too.