public void onEnable() {
	//        getServer().getPluginManager().registerEvents(this, this);
	//	System.out.println(getServer().getPluginManager().getPlugin("WorldGuard"));
		Plugin got_plugin = getServer().getPluginManager().getPlugin("WorldGuard");
		manager = new RegionFlagManager(this);
		createDefaultConfig(new File(getDataFolder(), "config.yml"), "config.yml");

		if(got_plugin instanceof WorldGuardPlugin) {
			worldguard_plugin = (WorldGuardPlugin) got_plugin;
			WORLDGUARD = worldguard_plugin;
		}
		if(!setupEcon()) {
			System.out.println("[FATAL ERROR] MineEstates requires Vault and a Vault-compatible Economy plugin to be installed to interface with the economy! Please install Vault");
			getServer().getPluginManager().disablePlugin(this);
			return;
		}
		if(!setupPerms()) {
			System.out.println("[FATAL ERROR] MineEstates requires a Vault-Compatible permissions plugin and Vault itself. Please install both of these. Check Vault's page to see if your permissions plugin works with it.");
			getServer().getPluginManager().disablePlugin(this);
			return;
		}
	/*	if(!WORLDGUARD.getConfig().getBoolean("regions.sql.use")) {
			System.out.println("[FATAL ERROR] MineEstates REQUIRES WorldGuard to be using the MySQL Database for functionality!");
			return;
		} else {
			System.out.println("[MineEstates] WorldGuard using MySQL Database version.");
		}
	*/
		wg_config = new YAMLProcessor(new File(WORLDGUARD.getDataFolder(), "config.yml"), true, YAMLFormat.EXTENDED);
		try {
			wg_config.load();
		} catch (Exception e) {
			System.out.println(e);
			System.out.println("[FATAL ERROR] MineEstates unable to read WorldGuard config file! Please install WorldGuard before using MineEstates.");
			getServer().getPluginManager().disablePlugin(this);
			return;
		}

		if (!(config.getBoolean("storage.sql.use"))) {
			System.out.println("[FATAL ERROR] MineEstates currently requires the use of a MySQL database. Please configure your config.yml to use MySQL.");
			getServer().getPluginManager().disablePlugin(this);
			return;
		} else if((config.getBoolean("storage.sql.use-worldguard") && !wg_config.getBoolean("regions.sql.use"))) {
			System.out.println("[FATAL ERROR] WorldGuard must be using a  MySQL database if storage.sql.use-worldguard is set to true in MineEstats' config.yml");
			getServer().getPluginManager().disablePlugin(this);
		} else {
			EstateCommandExecutor cmd = new EstateCommandExecutor(this);
			getCommand("estates").setExecutor(cmd);
			if(config.getBoolean("storage.sql.use-worldguard"))
				db = new MySqlConnector(this, wg_config, true);
			else
				db = new MySqlConnector(this, config, false);
			//available = db.getAvailable();
		}
		rentColl = new RentCollector(this);
    }