新增版本更新检查

This commit is contained in:
zhangyuheng 2024-08-25 13:57:16 +08:00
parent 6c5ed0b2d1
commit 32033616fd
3 changed files with 12 additions and 1 deletions

View File

@ -4,7 +4,7 @@ plugins {
} }
group = "cn.lunadeer" group = "cn.lunadeer"
version = "2.3.1-beta" version = "2.3.2-beta"
java { java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21)) toolchain.languageVersion.set(JavaLanguageVersion.of(21))

View File

@ -141,6 +141,9 @@ public class Commands implements TabExecutor {
case "title_list": case "title_list":
TitleList.show(sender, args); TitleList.show(sender, args);
break; break;
case "version":
Operator.version(sender, args);
break;
// ---=== Sub Command ===--- // ---=== Sub Command ===---
case "member": case "member":
Member.handle(sender, args); Member.handle(sender, args);

View File

@ -4,6 +4,7 @@ import cn.lunadeer.dominion.Cache;
import cn.lunadeer.dominion.Dominion; import cn.lunadeer.dominion.Dominion;
import cn.lunadeer.dominion.dtos.DominionDTO; import cn.lunadeer.dominion.dtos.DominionDTO;
import cn.lunadeer.dominion.utils.MapRender; import cn.lunadeer.dominion.utils.MapRender;
import cn.lunadeer.minecraftpluginutils.GiteaReleaseCheck;
import cn.lunadeer.minecraftpluginutils.Notification; import cn.lunadeer.minecraftpluginutils.Notification;
import cn.lunadeer.minecraftpluginutils.Scheduler; import cn.lunadeer.minecraftpluginutils.Scheduler;
import cn.lunadeer.minecraftpluginutils.XLogger; import cn.lunadeer.minecraftpluginutils.XLogger;
@ -138,6 +139,13 @@ public class Operator {
}); });
} }
public static void version(CommandSender sender, String[] args) {
if (!hasPermission(sender, "dominion.admin")) {
return;
}
GiteaReleaseCheck.instance.getLatestRelease();
}
private static int convertWorld2Mca(int world) { private static int convertWorld2Mca(int world) {
return world < 0 ? world / 512 - 1 : world / 512; return world < 0 ? world / 512 - 1 : world / 512;
} }