修复了在购买不限量称号时可能产生-2的bug
All checks were successful
Java CI-CD with Maven / build (push) Successful in 8m36s
All checks were successful
Java CI-CD with Maven / build (push) Successful in 8m36s
This commit is contained in:
parent
c4d25b79cf
commit
706ea9a5a5
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>MiniPlayerTitle</artifactId>
|
||||
<version>4.2.1</version>
|
||||
<version>4.2.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>MiniPlayerTitle</name>
|
||||
|
@ -178,14 +178,18 @@ public class TitleShopSale {
|
||||
Notification.error(player, "购买称号时出现错误,详情请查看控制台日志");
|
||||
return;
|
||||
}
|
||||
titleShop.setAmount(titleShop.getAmount() - 1);
|
||||
if (titleShop.getAmount() >= 1) {
|
||||
titleShop.setAmount(titleShop.getAmount() - 1);
|
||||
}
|
||||
playerInfo.setCoin(playerInfo.getCoin() - titleShop.getPrice());
|
||||
Notification.info(player, Component.text("成功购买称号: ").append(had.getTitle().getTitleColored()));
|
||||
} else if (!had.isExpired()) {
|
||||
Notification.warn(player, "你已拥有此称号,在过期前无法再次购买");
|
||||
} else {
|
||||
had.setExpireAt(titleShop.getDays() == -1 ? null : LocalDateTime.now().plusDays(titleShop.getDays()));
|
||||
titleShop.setAmount(titleShop.getAmount() - 1);
|
||||
if (titleShop.getAmount() >= 1) {
|
||||
titleShop.setAmount(titleShop.getAmount() - 1);
|
||||
}
|
||||
playerInfo.setCoin(playerInfo.getCoin() - titleShop.getPrice());
|
||||
Notification.info(player, Component.text("成功续续期称号: ").append(had.getTitle().getTitleColored()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user