Hey!
Today I will show you the best and the easiest way to get the instance of your Main class in Java!
This will be useful in coding Minecraft plugins.
You gonna put this code into the Main class:
Now, to get Instance you do 
If your Main class is named for example "ClassName123", then replace "Main" in the code to the name of your class, and call it with it's name either!
I hope his helped!
Regards
Marcelektro-kun
Did you know I use this in marCloud's source code?
Today I will show you the best and the easiest way to get the instance of your Main class in Java!
This will be useful in coding Minecraft plugins.
You gonna put this code into the Main class:
Java:
public static Main plugin;
public Main() {
if(plugin != null) {
throw new IllegalStateException("Nani!");
} else {
plugin = this;
}
}
public static Main getInstance() {
return plugin;
}
Main.getInstance()
and you have it If your Main class is named for example "ClassName123", then replace "Main" in the code to the name of your class, and call it with it's name either!
I hope his helped!
Regards
Marcelektro-kun
Did you know I use this in marCloud's source code?