From 06b3aee9bf81e5fff1c6e8981dfe1eee4869ba23 Mon Sep 17 00:00:00 2001 From: ASangarin Date: Sun, 1 Nov 2020 15:33:02 +0100 Subject: [PATCH] Boosters now properly shows that they're expired. Please add " booster-expired: '&cExpired!' " to your messages.yml --- src/main/java/net/Indyuce/mmocore/gui/PlayerStats.java | 9 ++++++--- src/main/resources/default/messages.yml | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/gui/PlayerStats.java b/src/main/java/net/Indyuce/mmocore/gui/PlayerStats.java index 09e7771e..a4268336 100644 --- a/src/main/java/net/Indyuce/mmocore/gui/PlayerStats.java +++ b/src/main/java/net/Indyuce/mmocore/gui/PlayerStats.java @@ -181,7 +181,9 @@ public class PlayerStats extends EditableInventory { holders.register("author", boost.hasAuthor() ? boost.getAuthor() : "Server"); holders.register("value", (int) (boost.getExtra() * 100)); - holders.register("left", new DelayFormat(2).format(boost.getLeft())); + holders.register("left", boost.isTimedOut() ? + MMOCore.plugin.configManager.getSimpleMessage("booster-expired").message() + : new DelayFormat(2).format(boost.getLeft())); return holders; } @@ -199,7 +201,9 @@ public class PlayerStats extends EditableInventory { holders.register("author", boost.hasAuthor() ? boost.getAuthor() : "Server"); holders.register("profession", boost.getProfession().getName()); holders.register("value", (int) (boost.getExtra() * 100)); - holders.register("left", new DelayFormat(2).format(boost.getLeft())); + holders.register("left", boost.isTimedOut() ? + MMOCore.plugin.configManager.getSimpleMessage("booster-expired").message() + : new DelayFormat(2).format(boost.getLeft())); return holders; } @@ -274,7 +278,6 @@ public class PlayerStats extends EditableInventory { @Override public Placeholders getPlaceholders(PluginInventory inv, int n) { - PlayerData data = inv.getPlayerData(); Placeholders holders = new Placeholders(); diff --git a/src/main/resources/default/messages.yml b/src/main/resources/default/messages.yml index 3723dc74..d76f36e3 100644 --- a/src/main/resources/default/messages.yml +++ b/src/main/resources/default/messages.yml @@ -25,6 +25,7 @@ booster-skill: - '&e' - '&eA &6{multiplier}x&e &6{profession} &eEXP multiplier is now active!' - '&e' +booster-expired: '&cExpired!' # Fishing Profession caught-fish: '&cYou caught a fish!'