if (controller.configuration.ignoreUpdates()) {
return;
}
InputStream is = null;
ConfigurationNode node = new ConfigurationNode(new HashMap<String, Object>());
try {
URL url = new URL(controller.getConfiguration().getUpdateFile());
url.openConnection();
is = url.openStream();
Yaml yaml = new Yaml();
Object out = yaml.load(new UnicodeReader(is));
try {
if (null != out) {
node.setRoot((Map<String, Object>) out);
}
} catch (ClassCastException e) {
throw new ConfigurationException("Root document must be an key-value structure");
}
String currentVersion = node.getString("updaterVersion" + this.updaterVersion + ".current");
List<String> supportedVersions = node.getStringList("updaterVersion" + this.updaterVersion + ".supported", new ArrayList<String>());
if (currentVersion != null && !currentVersion.equals(WorldEditCUI.VERSION) && !(currentVersion + "beta").equals(WorldEditCUI.VERSION)) {
if (supportedVersions != null && !supportedVersions.contains(WorldEditCUI.VERSION)) {
controller.getObfuscation().showChatMessage(ChatColor.RED + "Your WorldEditCUI version is out of date! ");
controller.getObfuscation().showChatMessage(ChatColor.RED + "The latest version is " + currentVersion + ". http://bit.ly/wecui");