@Override
	public void onEnable() {
		instance = this;
		server = getServer();
		config = new Config(this);
		debug = config.getDebug();
		version = getDescription().getVersion();
		usethread = config.getUseThread();
		
		try {
			mt = new Metrics();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		setUpdateInfo();
		
		if (!setupVault()) {
			send("Vault support is disabled. This option can be changed in the config.");
			va = false;
		} else {
			send("Vault support is enabled.");
			va = true;
		}
		
		if (!version.equals(newversion) && !version.contains("TEST"))
			send("New update is available for CouponCodes! Current version: "+version+" New version: "+newversion);
		
		// This is for this plugin's own events!
		server.getPluginManager().registerEvents(new DebugListen(this), this);
		
		// Bukkit listeners
		server.getPluginManager().registerEvents(new PlayerListen(this), this);
		
		if (!setupSQL()) {
			send("Database could not be setup. CouponCodes will now disable");
			server.getPluginManager().disablePlugin(this);
			return;
		}
		
		// Timers!
		if (usethread) {
			getServer().getScheduler().scheduleAsyncRepeatingTask(this, new CouponTimer(), 200L, 200L);
		}
		
		// This timer is required, so it can't be in (usethread)!
		getServer().getScheduler().scheduleAsyncDelayedTask(this, new CustomDataSender(this, mt));
		
		send("is now enabled! Version: "+version);
	}