Make the jail stick manager/creation smarter and fix jailing via jail

sticks, as it wasn't working at all.
This commit is contained in:
graywolf336
2014-07-15 01:05:46 -05:00
parent d034a0f1ed
commit 8a7a9cefef
7 changed files with 77 additions and 94 deletions

View File

@ -78,7 +78,6 @@ public class JailMain extends JavaPlugin {
cmdHand = new CommandHandler(this);
jh = new JailHandler(this);
pm = new PrisonerManager(this);
jsm = new JailStickManager(this);
PluginManager plm = this.getServer().getPluginManager();
plm.registerEvents(new BlockListener(this), this);
@ -101,6 +100,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);
reloadJailPayManager();
@ -188,9 +191,11 @@ public class JailMain extends JavaPlugin {
/** Reloads the Jail Sticks, so the new ones can be loaded from the config. */
public void reloadJailSticks() {
this.jsm.removeAllStickUsers();
this.jsm = null;
this.jsm = new JailStickManager(this);
if(getConfig().getBoolean(Settings.JAILSTICKENABLED.getPath())) {
this.jsm.removeAllStickUsers();
this.jsm = null;
this.jsm = new JailStickManager(this);
}
}
/**