@Override
	public void onEnable(){
		instance = this;

		// Check configuration
		getConfig().loadDefaults(getResource("resources/config.yml"));
		if(!getConfig().fileExists() || !getConfig().checkDefaults()){
			getConfig().saveDefaults();
		}
		getConfig().load();

		// Load Vault (if we can)
		Plugin plugin = getServer().getPluginManager().getPlugin("Vault");
		if(plugin != null){
			perms = new VaultPerms();
			econ = new VaultEcon();
			if(econ.isNull()){ // We require economy
				getLogger().severe("This plugin requires Vault (and an economy) to work!");
				getServer().getPluginManager().disablePlugin(this);
				return;
			}
		}else{
			getLogger().severe("This plugin requires Vault to work!");
			getServer().getPluginManager().disablePlugin(this);
			return;
		}

		// Setup lottery function
		pot = new Pot();
		pot.add(getConfig().getDouble("lottery.current-pot", 0));

		// Commands setup
		LotteryCommands commands = new LotteryCommands();
		getCommand("lottery").setExecutor(commands);
		getCommand("lotteryadmin").setExecutor(commands);

		// For login message
		getServer().getPluginManager().registerEvents(this, this);

		// Start countdown
		long runtimeRaw = getConfig().getLong("general.draw-every");
		long runtime = runtimeRaw * 60 * 60 * 20;
		long left = getConfig().getLong("lottery.time-left", runtime);
		countdown = new Countdown();
		cdLoop = new CountdownLoop(left, runtime, countdown);
		countdown.setListener(cdLoop);

		// Spam console
		getLogger().info("Loaded! Plugin by turt2live");
	}