Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cloudcraftgaming.bettermessages; //change this to your package name.
- //I have only included the things needed to register the update checker and allow it to check for an update when the server starts.
- import java.io.File;
- import java.io.IOException;
- import org.bukkit.Bukkit;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main
- extends JavaPlugin {
- public UpdateChecker updateChecker; //this is the variable for the update checker.
- public void onDisable() {}
- public void onEnable() {
- 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)
- if (getConfig().getString("Check for Updates").equalsIgnoreCase("True")) {
- if (this.updateChecker.UpdateNeeded()) {
- getLogger().info("A new version of <plugin name here> is available: " + this.updateChecker.getVersion());
- getLogger().info("Download it from: " + this.updateChecker.getLink());
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement