@Override
	public void onEnable() {
		if (StatisticianPlugin.singleton != null) return;

		StatisticianPlugin.singleton = this;

		this.setNaggable(false);

		if (this.database == null) {
			try {
				this.database = new Database();
			} catch (ClassNotFoundException e) {
				this.getLogger().severe("MySQL Driver not found");
				if (Config.getConfig().isVerboseErrors()) {
					e.printStackTrace();
				}
			} catch (DBConnectFail e) {
				this.getLogger().log(Level.SEVERE, "Critical Error, could not connect to mySQL. Is the database Available? Check config file and try again. (" + e.getMessage() + ")");
				if (Config.getConfig().isVerboseErrors()) {
					e.printStackTrace();
				}
			}
		}
		if (this.database == null) {
			StatisticianPlugin.singleton = null;
			this.getPluginLoader().disablePlugin(this);
			return;
		}

		DataValues_Config.refresh();

		this.database.callStoredProcedure("pluginStartup", null);

		this.executorService = Executors.newCachedThreadPool();

		this.edhPlayer = new EDHPlayer();

		this.playerData = new PlayerData();

		this.dataProcessor = new DataProcessor();
		this.dataProcessor.addProcessable(this.playerData);

		this.dataProcessorTimer = new Timer(true);
		this.dataProcessorTimer.scheduleAtFixedRate(this.dataProcessor, Config.getConfig().getDBUpdateTime(), Config.getConfig().getDBUpdateTime());
	
		// Setup Listeners
		this.playerListener = new PlayerListener(this.edhPlayer);
		this.blockListener = new BlockListener(this.edhPlayer);
		this.entityListener = new EntityListener(this.edhPlayer);
		//this.inventoryListener = new InventoryListener(this.edhPlayer);

		this.registerEvents();

		// This could be a reload so see if people are logged in
		for (Player player : this.getServer().getOnlinePlayers()) {
			this.edhPlayer.PlayerJoin(player);
		}
	}