This commit is contained in:
parent
ddf5ae711a
commit
a007966d70
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>cn.lunadeer</groupId>
|
<groupId>cn.lunadeer</groupId>
|
||||||
<artifactId>MiniPlayerTitle</artifactId>
|
<artifactId>MiniPlayerTitle</artifactId>
|
||||||
<version>4.2.6</version>
|
<version>4.2.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>MiniPlayerTitle</name>
|
<name>MiniPlayerTitle</name>
|
||||||
|
@ -158,29 +158,29 @@ public class TitleManage {
|
|||||||
Notification.info(sender, "已卸下称号");
|
Notification.info(sender, "已卸下称号");
|
||||||
playerInfo.setUsingTitle(null);
|
playerInfo.setUsingTitle(null);
|
||||||
updateName(player, null);
|
updateName(player, null);
|
||||||
return;
|
|
||||||
}
|
|
||||||
PlayerTitleDTO title = PlayerTitleDTO.get(id);
|
|
||||||
if (title == null) {
|
|
||||||
Notification.error(sender, "称号不存在");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!title.getPlayerUuid().equals(player.getUniqueId())) {
|
|
||||||
Notification.error(sender, "该称号不属于你");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (title.isExpired()) {
|
|
||||||
Notification.error(sender, "称号 %s 已过期", title.getTitle().getTitlePlainText());
|
|
||||||
playerInfo.setUsingTitle(null);
|
|
||||||
updateName(player, null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean success = playerInfo.setUsingTitle(title.getTitle());
|
|
||||||
if (success) {
|
|
||||||
updateName((Player) sender, title.getTitle());
|
|
||||||
Notification.info(sender, "已使用称号");
|
|
||||||
} else {
|
} else {
|
||||||
Notification.error(sender, "使用称号失败,具体请查看控制台日志");
|
PlayerTitleDTO title = PlayerTitleDTO.get(id);
|
||||||
|
if (title == null) {
|
||||||
|
Notification.error(sender, "称号不存在");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!title.getPlayerUuid().equals(player.getUniqueId())) {
|
||||||
|
Notification.error(sender, "该称号不属于你");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (title.isExpired()) {
|
||||||
|
Notification.error(sender, "称号 %s 已过期", title.getTitle().getTitlePlainText());
|
||||||
|
playerInfo.setUsingTitle(null);
|
||||||
|
updateName(player, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean success = playerInfo.setUsingTitle(title.getTitle());
|
||||||
|
if (success) {
|
||||||
|
updateName((Player) sender, title.getTitle());
|
||||||
|
Notification.info(sender, "已使用称号");
|
||||||
|
} else {
|
||||||
|
Notification.error(sender, "使用称号失败,具体请查看控制台日志");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length == 3) {
|
if (args.length == 3) {
|
||||||
|
@ -47,7 +47,7 @@ public class MyTitles {
|
|||||||
} else {
|
} else {
|
||||||
line.append("有效期至: " + title.getExpireAt().getYear() + "年" + title.getExpireAt().getMonthValue() + "月" + title.getExpireAt().getDayOfMonth() + "日");
|
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());
|
line.append(Button.createRed("卸下").setExecuteCommand("/mplt use_title -1 " + page).build());
|
||||||
} else {
|
} else {
|
||||||
line.append(Button.createGreen("使用").setExecuteCommand("/mplt use_title " + title.getId() + " " + page).build());
|
line.append(Button.createGreen("使用").setExecuteCommand("/mplt use_title " + title.getId() + " " + page).build());
|
||||||
|
Loading…
Reference in New Issue
Block a user