Advertisement
Guest User

Untitled

a guest
May 29th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.cloudcraftgaming.bettermessages; //change this to your package name.
  2. //I have only included the things needed to register the update checker and allow it to check for an update when the server starts.
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.configuration.file.FileConfiguration;
  8. import org.bukkit.configuration.file.YamlConfiguration;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class Main
  12. extends JavaPlugin {
  13.     public UpdateChecker updateChecker; //this is the variable for the update checker.
  14.  
  15.   public void onDisable() {}
  16.  
  17.   public void onEnable() {
  18.    
  19.       this.updateChecker = new UpdateChecker(this, "your files link here"); //in order for it the check for an update of your plugin, you will need to place the link to your bukkit plugins files replacing the /files/ with /files.rss (Example: http://dev.bukkit.org/bukkit-plugins/bettermessages/files.rss)
  20.         if (getConfig().getString("Check for Updates").equalsIgnoreCase("True")) {
  21.             if (this.updateChecker.UpdateNeeded()) {
  22.                     getLogger().info("A new version of <plugin name here> is available: " + this.updateChecker.getVersion());
  23.                     getLogger().info("Download it from: " + this.updateChecker.getLink());
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement