Avoided setting static variable in non-static method.

This commit is contained in:
Tastybento 2018-02-06 21:31:19 -08:00
parent 5a5ae2d077
commit 2d64070d3f

View File

@ -49,8 +49,8 @@ public class BSkyBlock extends JavaPlugin {
public void onEnable(){
// Save the default config from config.yml
saveDefaultConfig();
plugin = this;
setInstance(this);
settings = new Settings();
// Load settings from config.yml. This will check if there are any issues with it too.
try {
@ -184,6 +184,10 @@ public class BSkyBlock extends JavaPlugin {
return islandsManager;
}
private static void setInstance(BSkyBlock plugin) {
BSkyBlock.plugin = plugin;
}
public static BSkyBlock getInstance() {
return plugin;
}