Fixed the Version command.

Bad case of the copy pastes...
This commit is contained in:
Eric Stokes 2011-07-19 17:21:44 -06:00
parent 9eff255f47
commit c678750c90
4 changed files with 32 additions and 9 deletions

View File

@ -13,7 +13,7 @@ import com.pneumaticraft.commandhandler.PermissionsInterface;
public class MVPermissions implements PermissionsInterface {
private MultiverseCore plugin;
public PermissionHandler permissions = null;
private PermissionHandler permissions = null;
/**
* Constructor FTW
@ -94,4 +94,11 @@ public class MVPermissions implements PermissionsInterface {
return !isOpRequired && opFallback;
}
public String getType() {
if (this.permissions != null) {
return "Permissions " + this.plugin.getServer().getPluginManager().getPlugin("Permissions").getDescription().getVersion();
}
return "Bukkit Permissions/OPs.txt";
}
}

View File

@ -33,9 +33,9 @@ public class MVPluginListener extends ServerListener {
}
// Let AllPay handle all econ plugin loadings, only go for econ plugins we support
if (Arrays.asList(AllPay.validEconPlugins).contains(event.getPlugin().getDescription().getName())) {
this.plugin.bank = this.plugin.banker.loadEconPlugin();
this.plugin.setBank(this.plugin.getBanker().loadEconPlugin());
}
if (event.getPlugin().getDescription().getName().equalsIgnoreCase("MultiVerse")) {
if (event.getPlugin().getDescription().getName().equals("MultiVerse")) {
this.plugin.getServer().getPluginManager().disablePlugin(event.getPlugin());
this.plugin.log(Level.WARNING, "I just disabled the old version of Multiverse for you. You should remove the JAR now, your configs have been migrated.");
new DefaultConfiguration(this.plugin.getDataFolder(), "config.yml", this.plugin.migrator);

View File

@ -67,8 +67,8 @@ public class MultiverseCore extends JavaPlugin {
// HashMap to contain information relating to the Players.
private HashMap<String, MVPlayerSession> playerSessions;
private PurgeWorlds worldPurger;
public GenericBank bank = null;
public AllPay banker = new AllPay(this, "[Multiverse-Core] ");
private GenericBank bank = null;
private AllPay banker = new AllPay(this, "[Multiverse-Core] ");
public static boolean defaultConfigsCreated = false;
protected MVConfigMigrator migrator = new MVConfigMigrator(this);
protected int pluginCount;
@ -85,6 +85,10 @@ public class MultiverseCore extends JavaPlugin {
public Configuration getConfig() {
return this.configMV;
}
public GenericBank getBank() {
return this.bank;
}
public void onEnable() {
// Output a little snippet to show it's enabled.
@ -96,6 +100,7 @@ public class MultiverseCore extends JavaPlugin {
this.ph = new MVPermissions(this);
this.bank = this.banker.loadEconPlugin();
// Setup the command manager
this.commandHandler = new CommandHandler(this, this.ph);
// Setup the world purger
@ -620,4 +625,12 @@ public class MultiverseCore extends JavaPlugin {
public void decrementPluginCount() {
this.pluginCount -= 1;
}
public AllPay getBanker() {
return this.banker;
}
public void setBank(GenericBank bank) {
this.bank = bank;
}
}

View File

@ -29,14 +29,17 @@ public class VersionCommand extends MultiverseCommand {
sender.sendMessage("Version info dumped to console. Please check your server logs.");
}
this.plugin.log(Level.INFO, "Multiverse-Core Version: " + this.plugin.getDescription().getVersion());
this.plugin.log(Level.INFO, "Bukkit Version: " + this.plugin.getServer().getVersion());
this.plugin.log(Level.INFO, "Loaded Worlds: " + this.plugin.getMVWorlds().size());
this.plugin.log(Level.INFO, "Multiverse Plugins Loaded: " + this.plugin.getPluginCount());
this.plugin.log(Level.INFO, "Economy being used: " + this.plugin.getBank().getEconUsed());
this.plugin.log(Level.INFO, "Permissions Plugin: " + this.plugin.getPermissions().getType());
this.plugin.log(Level.INFO, "Dumping Config Values: (version " + this.plugin.getConfig().getString("version", "NOT SET") + ")");
this.plugin.log(Level.INFO, "messagecooldown: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
this.plugin.log(Level.INFO, "teleportcooldown: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
this.plugin.log(Level.INFO, "teleportcooldown: " + this.plugin.getConfig().getString("teleportcooldown", "NOT SET"));
this.plugin.log(Level.INFO, "worldnameprefix: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
this.plugin.log(Level.INFO, "opfallback: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
this.plugin.log(Level.INFO, "disableautoheal: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
this.plugin.log(Level.INFO, "fakepvp: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET"));
this.plugin.log(Level.INFO, "opfallback: " + this.plugin.getConfig().getString("worldnameprefix", "NOT SET"));
this.plugin.log(Level.INFO, "disableautoheal: " + this.plugin.getConfig().getString("disableautoheal", "NOT SET"));
this.plugin.log(Level.INFO, "fakepvp: " + this.plugin.getConfig().getString("fakepvp", "NOT SET"));
}
}