This commit is contained in:
parent
fc5f167587
commit
25fe5fbb09
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.3</version>
|
<version>4.2.4</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>MiniPlayerTitle</name>
|
<name>MiniPlayerTitle</name>
|
||||||
|
@ -148,7 +148,19 @@ public class TitleManage {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
PlayerTitleDTO title = PlayerTitleDTO.get(Integer.parseInt(args[1]));
|
PlayerInfoDTO playerInfo = PlayerInfoDTO.get((player).getUniqueId());
|
||||||
|
if (playerInfo == null) {
|
||||||
|
Notification.error(sender, "获取玩家信息时出现错误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int id = Integer.parseInt(args[1]);
|
||||||
|
if (id == -1) {
|
||||||
|
Notification.info(sender, "已卸下称号");
|
||||||
|
playerInfo.setUsingTitle(null);
|
||||||
|
updateName(player, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PlayerTitleDTO title = PlayerTitleDTO.get(id);
|
||||||
if (title == null) {
|
if (title == null) {
|
||||||
Notification.error(sender, "称号不存在");
|
Notification.error(sender, "称号不存在");
|
||||||
return;
|
return;
|
||||||
@ -157,11 +169,6 @@ public class TitleManage {
|
|||||||
Notification.error(sender, "该称号不属于你");
|
Notification.error(sender, "该称号不属于你");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlayerInfoDTO playerInfo = PlayerInfoDTO.get((player).getUniqueId());
|
|
||||||
if (playerInfo == null) {
|
|
||||||
Notification.error(sender, "获取玩家信息时出现错误");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (title.isExpired()) {
|
if (title.isExpired()) {
|
||||||
Notification.error(sender, "称号 %s 已过期", title.getTitle().getTitlePlainText());
|
Notification.error(sender, "称号 %s 已过期", title.getTitle().getTitlePlainText());
|
||||||
playerInfo.setUsingTitle(null);
|
playerInfo.setUsingTitle(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user