2.53.2 - ban times will say expired if it drops below zero rather than showing negeative numbers

This commit is contained in:
Kiran Hart 2022-01-20 12:24:42 -05:00
parent 0cbc9482e1
commit e5b69121d0
3 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.tweetzy</groupId>
<artifactId>auctionhouse</artifactId>
<version>2.53.1</version>
<version>2.53.2</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -66,7 +66,7 @@ public class GUIBans extends Gui {
put("%player_name%", offlinePlayer.getName());
put("%player_displayname%", AuctionAPI.getInstance().getDisplayName(offlinePlayer));
put("%ban_reason%", ban.getReason());
put("%ban_amount%", TimeUtils.makeReadable(ban.getTime() - System.currentTimeMillis()));
put("%ban_amount%", (ban.getTime() - System.currentTimeMillis()) <= 0 ? AuctionHouse.getInstance().getLocale().getMessage("bans.ban expired").getMessage() : TimeUtils.makeReadable(ban.getTime() - System.currentTimeMillis()));
}}), ClickType.RIGHT, e -> {
AuctionHouse.getInstance().getAuctionBanManager().removeBan(ban.getBannedPlayer());
AuctionHouse.getInstance().getLocale().getMessage("bans.playerunbanned").processPlaceholder("player_displayname", AuctionAPI.getInstance().getDisplayName(offlinePlayer)).processPlaceholder("player", offlinePlayer.getName()).sendPrefixedMessage(e.player);

View File

@ -101,6 +101,7 @@ public class LocaleSettings {
languageNodes.put("bans.playerunbanned", "&cUnbanned &4%player% &cfrom the auction house");
languageNodes.put("bans.remainingtime", "&cYou are banned from the auction house for &4%ban_amount%");
languageNodes.put("bans.unbanned", "&aYou are now unbanned from the auction house");
languageNodes.put("bans.ban expired", "&aBan Expired");
languageNodes.put("auction_filter.sale_types.biddable", "Biddable");
languageNodes.put("auction_filter.sale_types.non_biddable", "Not Biddable");