package musician101.itembank;

import java.io.File;

import musician101.itembank.commands.ItemAliasCommand;
import musician101.itembank.commands.dwcommands.DepositCommand;
import musician101.itembank.commands.dwcommands.WithdrawCommand;
import musician101.itembank.commands.ibcommand.IBCommand;
import musician101.itembank.listeners.PlayerListener;
import musician101.itembank.util.IBUtils;
import musician101.itembank.util.ItemTranslator;
import musician101.itembank.util.Update;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * The plugin's main class.
 * 
 * @author Musician101
 */
public class ItemBank extends JavaPlugin
{
	public Config config;
	public ItemTranslator translator;
	public File playerDataDir;
	public File playerFile;
	public FileConfiguration playerData;
	public static Econ economy = null;
	
	/** Checks if a new version is available. */
	public void versionCheck(Config config)
	{
		@SuppressWarnings("unused")
		Update update = null; 
		if (config.checkForUpdate)
			update = new Update(59073, "72784c134bdbc3c2216591011a29df99fac08239");
		else
			getLogger().info("Updater is disabled.");
	}
	
	/** Initializes the plugin, checks for the config, and register commands and listeners. */
	public void onEnable()
	{
		playerDataDir = new File(getDataFolder() + "/PlayerData");
		config = new Config(this);
		economy = new Econ();
		if (economy.isEnabled() && config.enableVault)
			getLogger().info("Vault detected and enabled in config. Using Vault for monetary transactions.");
		else if (!economy.isEnabled())
			getLogger().info("Error detecting Vault. Is it installed?");
		else if (!config.enableVault)
			getLogger().info("Vault detected but disabled in config. No monetary transactions will occur.");
		
		IBUtils.createPlayerFiles(this, Bukkit.getOnlinePlayers());
		
		getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
		
		getCommand("deposit").setExecutor(new DepositCommand(this, config));
		getCommand("itemalias").setExecutor(new ItemAliasCommand(this));
		getCommand("withdraw").setExecutor(new WithdrawCommand(this, config));
		getCommand("itembank").setExecutor(new IBCommand(this));
		
		versionCheck(config);
	}
	
	/** Shuts off the plugin */
	public void onDisable()
	{
		getLogger().info("Shutting down.");
	}
	
	/**
	 * Get economy related methods.
	 *
	 * @return
	 */
	public Econ getEconomy()
	{
		return economy;
	}
}

@@ -983,16 +983,50 @@
 fig)%0A%09%7B%0A
+%09%09if (config.checkForUpdate)%0A%09%09%7B%0A%09
 %09%09@Suppr
@@ -1049,16 +1049,17 @@
 sed%22)%0A%09%09
+%09
 Update u
@@ -1069,56 +1069,8 @@
 te =
- null; %0A%09%09if (config.checkForUpdate)%0A%09%09%09update =
  new
@@ -1125,24 +1125,28 @@
 fac08239%22);%0A
+%09%09%7D%0A
 %09%09else%0A%09%09%09ge

Change 3 lines to 2.