@SuppressWarnings("deprecation")
	@Override
	public void onEnable() {
		info = getDescription();
		logger = Logger.getLogger("Minecraft");

		getConfig().options().copyDefaults(true);
		saveConfig();

		new File(mainDirectory).mkdir(); //makes the ColorKeys directory/folder in the plugins directory if it dosen't exist.

		DebugFiles.load();

		if(ColorKeysFiles.DoorsFile.exists())
			ColorKeysFiles.loadDoors();
		else
			DoorFiles.load();

		if(ColorKeysFiles.KeysFile.exists())
			ColorKeysFiles.loadKeys();
		else
			KeyFiles.load();

		if (getConfig().getBoolean("enable-economy")) {
			economyEnabled = true;

			try {
				RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);

				if (economyProvider != null) {
					economy = economyProvider.getProvider();
					Log(Level.INFO, "hooked into economy.");
				}
			}
			catch (NoClassDefFoundError e) {
				Log(Level.WARNING, "Vault plugin could not be found.");
			}
		}

		QueueFiles.load();

		getServer().getPluginManager().registerEvents(new BlockListener(this), this);
		getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
		getServer().getPluginManager().registerEvents(new SignShops(this), this);
		getServer().getPluginManager().registerEvents(this, this);

		getCommand("ck").setExecutor(new CommandHandler(this));

		Log(Level.INFO, "is enabled, version: " + info.getVersion());
		Log(Level.INFO, "written by [Musaddict, Dak393, FeedDante]");
	}