Skip to content

Commit

Permalink
add "new update is available" to VersionCommand.java
Browse files Browse the repository at this point in the history
  • Loading branch information
NONPLAYT committed Sep 2, 2023
1 parent ca0e493 commit 6343146
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import gq.bxteam.ndailyrewards.NDailyRewards;
import gq.bxteam.ndailyrewards.cfg.Lang;
import gq.bxteam.ndailyrewards.cmds.ICmd;
import gq.bxteam.ndailyrewards.utils.TextUtils;
import org.bukkit.command.CommandSender;

public class VersionCommand extends ICmd
Expand All @@ -13,7 +14,11 @@ public VersionCommand(final NDailyRewards plugin) {

@Override
public void perform(final CommandSender sender, final String[] args) {
sender.sendMessage(Lang.Prefix.toMsg() + "Current installed version is: " + this.plugin.getDescription().getVersion());
sender.sendMessage(Lang.Prefix.toMsg() + "Current installed version is: " + NDailyRewards.getInstance().getDescription().getVersion());
NDailyRewards.checkForUpdates().ifPresent(latestVersion -> {
sender.sendMessage(TextUtils.applyColor("&aAn update is available: " + latestVersion));
sender.sendMessage(TextUtils.applyColor("&aDownload here: https://modrinth.com/plugin/ndailyrewards/version/" + latestVersion));
});
}

@Override
Expand Down

0 comments on commit 6343146

Please sign in to comment.