diff options
| author | fatpigsarefat <fatpigsarefat@outlook.com> | 2018-04-18 21:07:28 +0100 |
|---|---|---|
| committer | fatpigsarefat <fatpigsarefat@outlook.com> | 2018-04-18 21:07:28 +0100 |
| commit | e8fd98bc1d7c01086b349e32151214ef6ed3cc6c (patch) | |
| tree | 4ee6bfb8863032db9457a9eabcfc73cb85400816 /src/me/fatpigsarefat/quests/commands/CommandQuests.java | |
| parent | 690f38cd36a3634bb29d8cdc832c81ef4ca07d3a (diff) | |
update command
Diffstat (limited to 'src/me/fatpigsarefat/quests/commands/CommandQuests.java')
| -rw-r--r-- | src/me/fatpigsarefat/quests/commands/CommandQuests.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/me/fatpigsarefat/quests/commands/CommandQuests.java b/src/me/fatpigsarefat/quests/commands/CommandQuests.java index c6ffe540..7428e1c8 100644 --- a/src/me/fatpigsarefat/quests/commands/CommandQuests.java +++ b/src/me/fatpigsarefat/quests/commands/CommandQuests.java @@ -13,6 +13,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; public class CommandQuests implements CommandExecutor { @@ -54,6 +55,20 @@ public class CommandQuests implements CommandExecutor { } sender.sendMessage(ChatColor.DARK_GRAY + "View info using /q a types [type]."); return true; + } else if (args[1].equalsIgnoreCase("update")) { + sender.sendMessage(ChatColor.GRAY + "Checking for updates..."); + new BukkitRunnable() { + @Override + public void run() { + Quests.getUpdater().check(); + if (Quests.getUpdater().isUpdateReady()) { + sender.sendMessage(Quests.getUpdater().getMessage()); + } else { + sender.sendMessage(ChatColor.GRAY + "No updates were found."); + } + } + }.runTaskAsynchronously(Quests.getInstance()); + return true; } } else if (args.length == 3) { if (args[1].equalsIgnoreCase("opengui")) { @@ -215,6 +230,7 @@ public class CommandQuests implements CommandExecutor { sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a moddata " + ChatColor.DARK_GRAY + ": view help for quest progression"); sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a types [type]" + ChatColor.DARK_GRAY + ": view registered task types"); sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a reload " + ChatColor.DARK_GRAY + ": reload Quests configuration"); + sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a update " + ChatColor.DARK_GRAY + ": check for updates"); } sender.sendMessage(ChatColor.GRAY.toString() + ChatColor.STRIKETHROUGH + "-----=[" + ChatColor.RED + " requires permission: quests.admin " + ChatColor.GRAY.toString() + ChatColor.STRIKETHROUGH + "]=-----"); |
