Permalink
Browse files

Remove automatic updater.

  • Loading branch information...
me4502 committed Dec 23, 2016
1 parent 77ebc7d commit 029b475394655824f0622ddbb372af5b65217f56
@@ -29,7 +29,6 @@
public long signClickTimeout;
public boolean convertNamesToCBID;
- public boolean updateNotifier;
public boolean easterEggs;
public boolean realisticRandoms;
@@ -100,9 +99,6 @@ public void load() {
config.setComment("st-think-ticks", "WARNING! Changing this can result in all ST mechanics acting very weirdly, only change this if you know what you are doing!");
stThinkRate = config.getInt("st-think-ticks", 2);
- config.setComment("notify-updates", "Enables the update notifier. This checks for updates on start, and notifies anyone with the permission when they join. They can then use /cb update to download the update.");
- updateNotifier = config.getBoolean("notify-updates", true);
-
config.setComment("safe-destruction", "Causes many mechanics to require sufficient blocks to function, for example gates, bridges and doors.");
safeDestruction = config.getBoolean("safe-destruction", true);
@@ -412,20 +412,6 @@ public void run () {
}
}
- public boolean updateAvailable = false;
- private String latestVersion = null;
- private long updateSize = 0;
-
- public String getLatestVersion() {
-
- return latestVersion;
- }
-
- public boolean isUpdateAvailable() {
-
- return updateAvailable;
- }
-
private YAMLProcessor mechanismsConfig;
/**
@@ -610,12 +596,6 @@ public void registerGlobalEvents() {
logDebugMessage("Registring managers!", "startup");
getServer().getPluginManager().registerEvents(managerAdapter, inst());
- if(config.updateNotifier) {
-
- logDebugMessage("Performing update checks!", "startup");
- checkForUpdates();
- }
-
if(config.easterEggs) {
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
@@ -688,51 +668,6 @@ public int getValue () {
}
}
- public void checkForUpdates() {
-
- boolean exempt = false;
-
- try {
- int ver = Integer.parseInt(getDescription().getVersion().split(":")[1].split("-")[0]);
- if (ver < 1541) //Not valid prior to this version.
- exempt = true;
- }
- catch(Exception e) {
- exempt = true;
- }
-
- if(!exempt) {
- final Updater updater = new Updater(this, getUpdaterID(), getFile(), Updater.UpdateType.NO_DOWNLOAD, true); // Start Updater but just do a version check
- updateAvailable = updater.getResult() == Updater.UpdateResult.UPDATE_AVAILABLE; // Determine if there is an update ready for us
- latestVersion = updater.getLatestName();
-
- getLogger().info(latestVersion + " is the latest version available, and the updatability of it is: " + updater.getResult().name() + ". You currently have version " + latestVersion + " installed.");
-
- if(updateAvailable) {
-
- for (Player player : getServer().getOnlinePlayers()) {
- if (hasPermission(player, "craftbook.update")) {
- player.sendMessage(ChatColor.YELLOW + "An update is available: " + latestVersion + "(" + updateSize + " bytes)");
- player.sendMessage(ChatColor.YELLOW + "Type /cb update if you would like to update.");
- }
- }
-
- getServer().getPluginManager().registerEvents(new Listener() {
- @EventHandler
- public void onPlayerJoin (PlayerJoinEvent event) {
- Player player = event.getPlayer();
- if (hasPermission(player, "craftbook.update")) {
- player.sendMessage(ChatColor.YELLOW + "An update is available: " + latestVersion + "(" + updateSize + " bytes)");
- player.sendMessage(ChatColor.YELLOW + "Type /cb update if you would like to update.");
- }
- }
- }, CraftBookPlugin.inst());
- }
- } else {
- getLogger().info("The Auto-Updater is disabled for your version!");
- }
- }
-
/**
* Called on plugin disable.
*/
Oops, something went wrong.

0 comments on commit 029b475

Please sign in to comment.