Only interaction with the jail stick manager when enabled. Closes #30

This commit is contained in:
graywolf336
2014-07-27 12:42:50 -05:00
parent 34acf4bbaa
commit 57e304f7c4
2 changed files with 72 additions and 70 deletions

View File

@ -105,13 +105,10 @@ public class JailMain extends JavaPlugin {
plm.registerEvents(this.mpl, this);
}
if(getConfig().getBoolean(Settings.JAILSTICKENABLED.getPath())) {
jsm = new JailStickManager(this);
}
jt = new JailTimer(this);
sbm = new ScoreBoardManager(this);
reloadJailPayManager();
reloadJailSticks();
reloadUpdateCheck();
new JailsAPI(this);
@ -201,8 +198,11 @@ public class JailMain extends JavaPlugin {
/** Reloads the Jail Sticks, so the new ones can be loaded from the config. */
public void reloadJailSticks() {
if(getConfig().getBoolean(Settings.JAILSTICKENABLED.getPath())) {
this.jsm.removeAllStickUsers();
this.jsm = null;
if(this.jsm != null) {
this.jsm.removeAllStickUsers();
this.jsm = null;
}
this.jsm = new JailStickManager(this);
}
}