Add new CH and CH checks

This commit is contained in:
Eric Stokes 2011-09-13 20:13:27 -06:00
parent 9c1a9769b2
commit 318564ccf2
2 changed files with 25 additions and 3 deletions

@ -1 +1 @@
Subproject commit 9bdd7dd59a4946acb5fd47e8813f903e5ba95e3b
Subproject commit ad5c57e56cb44061b1b0f6429ada625da26d434d

View File

@ -110,7 +110,8 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
protected int pluginCount;
private DestinationFactory destFactory;
private SpoutInterface spoutInterface = null;
private int allpayversion = 3;
private double allpayversion = 3;
private double chversion = 1;
@Override
public void onLoad() {
@ -131,7 +132,7 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
public void onEnable() {
// Perform initial checks for AllPay
if (!this.validateAllpay()) {
if (!this.validateAllpay() || !this.validateCH()) {
this.getServer().getPluginManager().disablePlugin(this);
return;
}
@ -191,6 +192,27 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
log.info(tag + " This plugin needs AllPay v" + allpayversion + " or higher!");
return false;
}
private boolean validateCH() {
try {
this.commandHandler = new CommandHandler(this, null);
if (this.commandHandler.getVersion() >= chversion) {
return true;
} else {
log.info(tag + " - Version " + this.getDescription().getVersion() + " was NOT ENABLED!!!");
log.info(tag + " A plugin that has loaded before " + this.getDescription().getName() + " has an incompatable version of CommandHandler (an internal library)!");
log.info(tag + " Please contact this plugin author!!!!!!!");
log.info(tag + " This plugin needs CommandHandler v" + chversion + " or higher and another plugin has loaded v" + this.commandHandler.getVersion() + "!");
return false;
}
} catch (Throwable t) {
}
log.info(tag + " - Version " + this.getDescription().getVersion() + " was NOT ENABLED!!!");
log.info(tag + " A plugin that has loaded before " + this.getDescription().getName() + " has an incompatable version of CommandHandler (an internal library)!");
log.info(tag + " Please contact this plugin author!!!!!!!");
log.info(tag + " This plugin needs CommandHandler v" + chversion + " or higher!");
return false;
}
private void initializeDestinationFactory() {
this.destFactory = new DestinationFactory(this);