mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-07-03 18:14:44 +02:00
Update to new AllPay version
This commit is contained in:
parent
89ea09fba2
commit
9c1a9769b2
|
@ -1 +1 @@
|
||||||
Subproject commit 5f40678ac750210a3121921af0c4e58e6516bfdb
|
Subproject commit 18c55a9070a5e64b2cb0737940290643f324fa7d
|
|
@ -105,12 +105,12 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
|
||||||
// HashMap to contain information relating to the Players.
|
// HashMap to contain information relating to the Players.
|
||||||
private HashMap<String, MVPlayerSession> playerSessions;
|
private HashMap<String, MVPlayerSession> playerSessions;
|
||||||
private GenericBank bank = null;
|
private GenericBank bank = null;
|
||||||
private AllPay banker = new AllPay(this, tag + " ");
|
private AllPay banker;
|
||||||
protected MVConfigMigrator migrator = new MVCoreConfigMigrator(this);
|
protected MVConfigMigrator migrator = new MVCoreConfigMigrator(this);
|
||||||
protected int pluginCount;
|
protected int pluginCount;
|
||||||
private DestinationFactory destFactory;
|
private DestinationFactory destFactory;
|
||||||
private SpoutInterface spoutInterface = null;
|
private SpoutInterface spoutInterface = null;
|
||||||
|
private int allpayversion = 3;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
|
@ -130,6 +130,12 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
// Perform initial checks for AllPay
|
||||||
|
if (!this.validateAllpay()) {
|
||||||
|
this.getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.banker = new AllPay(this, tag + " ");
|
||||||
// Output a little snippet to show it's enabled.
|
// Output a little snippet to show it's enabled.
|
||||||
this.log(Level.INFO, "- Version " + this.getDescription().getVersion() + " Enabled - By " + getAuthors());
|
this.log(Level.INFO, "- Version " + this.getDescription().getVersion() + " Enabled - By " + getAuthors());
|
||||||
this.checkServerProps();
|
this.checkServerProps();
|
||||||
|
@ -148,7 +154,6 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
|
||||||
|
|
||||||
this.playerSessions = new HashMap<String, MVPlayerSession>();
|
this.playerSessions = new HashMap<String, MVPlayerSession>();
|
||||||
|
|
||||||
|
|
||||||
// Start the Update Checker
|
// Start the Update Checker
|
||||||
// updateCheck = new UpdateChecker(this.getDescription().getName(), this.getDescription().getVersion());
|
// updateCheck = new UpdateChecker(this.getDescription().getName(), this.getDescription().getVersion());
|
||||||
|
|
||||||
|
@ -164,6 +169,29 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean validateAllpay() {
|
||||||
|
try {
|
||||||
|
this.banker = new AllPay(this, "Verify");
|
||||||
|
if (this.banker.getVersion() >= allpayversion) {
|
||||||
|
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 AllPay!");
|
||||||
|
log.info(tag + " The Following Plugins MAY out of date!");
|
||||||
|
log.info(tag + " This plugin needs AllPay v" + allpayversion + " or higher and another plugin has loaded v" + this.banker.getVersion() + "!");
|
||||||
|
log.info(tag + AllPay.pluginsThatUseUs.toString());
|
||||||
|
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 AllPay!");
|
||||||
|
log.info(tag + " Check the logs for [AllPay] - Version ... for PLUGIN NAME to find the culprit! Then Yell at that dev!");
|
||||||
|
log.info(tag + " Or update that plugin :P");
|
||||||
|
log.info(tag + " This plugin needs AllPay v" + allpayversion + " or higher!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void initializeDestinationFactory() {
|
private void initializeDestinationFactory() {
|
||||||
this.destFactory = new DestinationFactory(this);
|
this.destFactory = new DestinationFactory(this);
|
||||||
this.destFactory.registerDestinationType(WorldDestination.class, "");
|
this.destFactory.registerDestinationType(WorldDestination.class, "");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user