Merge branch 'master' of git@github.com:graywolf336/Jail.git
This commit is contained in:
commit
3ad2eb26af
@ -92,12 +92,7 @@ public class JailMain extends JavaPlugin {
|
|||||||
|
|
||||||
jt = new JailTimer(this);
|
jt = new JailTimer(this);
|
||||||
|
|
||||||
try {
|
reloadJailPayManager();
|
||||||
jpm = new JailPayManager(this);
|
|
||||||
} catch (Exception e) {
|
|
||||||
getLogger().severe(e.getMessage());
|
|
||||||
jpm = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
sbm = new ScoreBoardManager(this);
|
sbm = new ScoreBoardManager(this);
|
||||||
|
|
||||||
@ -192,9 +187,17 @@ public class JailMain extends JavaPlugin {
|
|||||||
*
|
*
|
||||||
* @throws Exception If we couldn't successfully create a new Jail Pay Manager instance.
|
* @throws Exception If we couldn't successfully create a new Jail Pay Manager instance.
|
||||||
*/
|
*/
|
||||||
public void reloadJailPayManager() throws Exception {
|
public void reloadJailPayManager() {
|
||||||
this.jpm = null;
|
this.jpm = null;
|
||||||
this.jpm = new JailPayManager(this);
|
|
||||||
|
if(getConfig().getBoolean(Settings.JAILPAYENABLED.getPath())) {
|
||||||
|
if(getServer().getPluginManager().isPluginEnabled("Vault")) {
|
||||||
|
this.jpm = new JailPayManager(this);
|
||||||
|
}else {
|
||||||
|
getConfig().set(Settings.JAILPAYENABLED.getPath(), false);
|
||||||
|
getLogger().severe("Jail Pay couldn't find an economy, disabling Jail Pay.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the {@link HandCuffManager} instance. */
|
/** Gets the {@link HandCuffManager} instance. */
|
||||||
|
@ -16,7 +16,7 @@ public class JailPayManager {
|
|||||||
private Material item;
|
private Material item;
|
||||||
private boolean infinite, timed;
|
private boolean infinite, timed;
|
||||||
|
|
||||||
public JailPayManager(JailMain plugin) throws Exception {
|
public JailPayManager(JailMain plugin) {
|
||||||
this.item = Material.getMaterial(plugin.getConfig().getString(Settings.JAILPAYITEM.getPath().toUpperCase()));
|
this.item = Material.getMaterial(plugin.getConfig().getString(Settings.JAILPAYITEM.getPath().toUpperCase()));
|
||||||
if(this.item == null) this.item = Material.AIR;
|
if(this.item == null) this.item = Material.AIR;
|
||||||
|
|
||||||
@ -25,7 +25,6 @@ public class JailPayManager {
|
|||||||
if(!this.usingItemsForPayment()) {
|
if(!this.usingItemsForPayment()) {
|
||||||
if(!this.setupEconomy(plugin)) {
|
if(!this.setupEconomy(plugin)) {
|
||||||
plugin.getConfig().set(Settings.JAILPAYENABLED.getPath(), false);
|
plugin.getConfig().set(Settings.JAILPAYENABLED.getPath(), false);
|
||||||
throw new Exception("Jail Pay couldn't find an economy, disabling Jail Pay.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user