// Path: UltimateSurvivalGames/src/me/maker56/survivalgames/listener/UpdateListener.java
// public class UpdateListener implements Listener {
// 	
// 	private static String version = null, updateInfo = null;;
// 	
// 	public static void update(String version) {
// 		UpdateListener.version = version;
// 		System.out.println("[SurvivalGames] A newer version of survivalgames is available. (" + version + ") You can download it here: http://dev.bukkit.org/bukkit-plugins/ultimatesurvivalgames/ You're using " + SurvivalGames.version);
// 		updateInfo = MessageHandler.getMessage("prefix") + "§eA newer version of SurvivalGames is available. §7(§b" + version + "§7) §eYou can download it here: §bhttp://dev.bukkit.org/bukkit-plugins/ultimatesurvivalgames/ §7You're using §o" + SurvivalGames.version;
// 		for(Player p : Bukkit.getOnlinePlayers()) {
// 			if(PermissionHandler.hasPermission(p, Permission.LOBBY) || PermissionHandler.hasPermission(p, Permission.ARENA)) {
// 				p.sendMessage(updateInfo);
// 			}
// 		}
// 	
// 	}
// 	
// 	@EventHandler(priority = EventPriority.MONITOR)
// 	public void onPlayerJoin(PlayerJoinEvent event) {
// 		Player p = event.getPlayer();
// 		if(PermissionHandler.hasPermission(p, Permission.LOBBY) || PermissionHandler.hasPermission(p, Permission.ARENA)) {
// 			if(version != null)
// 				p.sendMessage(updateInfo);
// 			if(outdated != null) {
// 				p.sendMessage("");
// 				p.sendMessage(outdated);
// 			}
// 		}
// 	}
// 	
// 	// TEMPORARY UPDATE STUFF
// 	private static String outdated = null;
// 	public static void setOutdatedMaps(String s) {
// 		outdated = s;
// 		for(Player p : Bukkit.getOnlinePlayers()) {
// 			if(PermissionHandler.hasPermission(p, Permission.LOBBY) || PermissionHandler.hasPermission(p, Permission.ARENA)) {
// 				p.sendMessage(s);
// 			}
// 		}
// 	}
// 
// }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import me.maker56.survivalgames.listener.UpdateListener;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
            }

            this.versionName = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.TITLE_VALUE);
            this.versionLink = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.LINK_VALUE);
            this.versionType = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.TYPE_VALUE);
            this.versionGameVersion = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.VERSION_VALUE);

            return true;
        } catch (final IOException e) {
            if (e.getMessage().contains("HTTP response code: 403")) {
                this.plugin.getLogger().severe("dev.bukkit.org rejected the API key provided in plugins/Updater/config.yml");
                this.plugin.getLogger().severe("Please double-check your configuration to ensure it is correct.");
                this.result = UpdateResult.FAIL_APIKEY;
            } else {
                this.plugin.getLogger().severe("The updater could not contact dev.bukkit.org for updating.");
                this.plugin.getLogger().severe("If you have not recently modified your configuration and this is the first time you are seeing this message, the site may be experiencing temporary downtime.");
                this.result = UpdateResult.FAIL_DBO;
            }
            return false;
        }
    }

    private class UpdateRunnable implements Runnable {

        @Override
        public void run() {
            if (UpdateCheck.this.url != null) {
                // Obtain the results of the project's file feed
                if (UpdateCheck.this.read()) {
                	if(!SurvivalGames.version.equals(UpdateCheck.this.versionName)) {
// Path: UltimateSurvivalGames/src/me/maker56/survivalgames/listener/UpdateListener.java
// public class UpdateListener implements Listener {
// 	
// 	private static String version = null, updateInfo = null;;
// 	
// 	public static void update(String version) {
// 		UpdateListener.version = version;
// 		System.out.println("[SurvivalGames] A newer version of survivalgames is available. (" + version + ") You can download it here: http://dev.bukkit.org/bukkit-plugins/ultimatesurvivalgames/ You're using " + SurvivalGames.version);
// 		updateInfo = MessageHandler.getMessage("prefix") + "§eA newer version of SurvivalGames is available. §7(§b" + version + "§7) §eYou can download it here: §bhttp://dev.bukkit.org/bukkit-plugins/ultimatesurvivalgames/ §7You're using §o" + SurvivalGames.version;
// 		for(Player p : Bukkit.getOnlinePlayers()) {
// 			if(PermissionHandler.hasPermission(p, Permission.LOBBY) || PermissionHandler.hasPermission(p, Permission.ARENA)) {
// 				p.sendMessage(updateInfo);
// 			}
// 		}
// 	
// 	}
// 	
// 	@EventHandler(priority = EventPriority.MONITOR)
// 	public void onPlayerJoin(PlayerJoinEvent event) {
// 		Player p = event.getPlayer();
// 		if(PermissionHandler.hasPermission(p, Permission.LOBBY) || PermissionHandler.hasPermission(p, Permission.ARENA)) {
// 			if(version != null)
// 				p.sendMessage(updateInfo);
// 			if(outdated != null) {
// 				p.sendMessage("");
// 				p.sendMessage(outdated);
// 			}
// 		}
// 	}
// 	
// 	// TEMPORARY UPDATE STUFF
// 	private static String outdated = null;
// 	public static void setOutdatedMaps(String s) {
// 		outdated = s;
// 		for(Player p : Bukkit.getOnlinePlayers()) {
// 			if(PermissionHandler.hasPermission(p, Permission.LOBBY) || PermissionHandler.hasPermission(p, Permission.ARENA)) {
// 				p.sendMessage(s);
// 			}
// 		}
// 	}
// 
// }


// Path: UltimateSurvivalGames/src/me/maker56/survivalgames/UpdateCheck.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import me.maker56.survivalgames.listener.UpdateListener;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;

            }

            this.versionName = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.TITLE_VALUE);
            this.versionLink = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.LINK_VALUE);
            this.versionType = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.TYPE_VALUE);
            this.versionGameVersion = (String) ((JSONObject) array.get(array.size() - 1)).get(UpdateCheck.VERSION_VALUE);

            return true;
        } catch (final IOException e) {
            if (e.getMessage().contains("HTTP response code: 403")) {
                this.plugin.getLogger().severe("dev.bukkit.org rejected the API key provided in plugins/Updater/config.yml");
                this.plugin.getLogger().severe("Please double-check your configuration to ensure it is correct.");
                this.result = UpdateResult.FAIL_APIKEY;
            } else {
                this.plugin.getLogger().severe("The updater could not contact dev.bukkit.org for updating.");
                this.plugin.getLogger().severe("If you have not recently modified your configuration and this is the first time you are seeing this message, the site may be experiencing temporary downtime.");
                this.result = UpdateResult.FAIL_DBO;
            }
            return false;
        }
    }

    private class UpdateRunnable implements Runnable {

        @Override
        public void run() {
            if (UpdateCheck.this.url != null) {
                // Obtain the results of the project's file feed
                if (UpdateCheck.this.read()) {
                	if(!SurvivalGames.version.equals(UpdateCheck.this.versionName)) {
                    	UpdateListener.update(UpdateCheck.this.versionName);