修复了称号背包展示逻辑错误问题
All checks were successful
Java CI-CD with Maven / build (push) Successful in 9m16s

This commit is contained in:
zhangyuheng 2024-07-01 14:40:12 +08:00
parent ddf5ae711a
commit a007966d70
3 changed files with 24 additions and 24 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>MiniPlayerTitle</artifactId>
<version>4.2.6</version>
<version>4.2.7</version>
<packaging>jar</packaging>
<name>MiniPlayerTitle</name>

View File

@ -158,8 +158,7 @@ public class TitleManage {
Notification.info(sender, "已卸下称号");
playerInfo.setUsingTitle(null);
updateName(player, null);
return;
}
} else {
PlayerTitleDTO title = PlayerTitleDTO.get(id);
if (title == null) {
Notification.error(sender, "称号不存在");
@ -182,6 +181,7 @@ public class TitleManage {
} else {
Notification.error(sender, "使用称号失败,具体请查看控制台日志");
}
}
if (args.length == 3) {
int page = Integer.parseInt(args[2]);

View File

@ -47,7 +47,7 @@ public class MyTitles {
} else {
line.append("有效期至: " + title.getExpireAt().getYear() + "" + title.getExpireAt().getMonthValue() + "" + title.getExpireAt().getDayOfMonth() + "");
}
if (Objects.equals(playerInfo.getUsingTitle().getId(), title.getId())) {
if (Objects.equals(playerInfo.getUsingTitle().getId(), title.getTitle().getId())) {
line.append(Button.createRed("卸下").setExecuteCommand("/mplt use_title -1 " + page).build());
} else {
line.append(Button.createGreen("使用").setExecuteCommand("/mplt use_title " + title.getId() + " " + page).build());