From 72857cbc08a99d9c4ad0c94112b17cf8aa2306f4 Mon Sep 17 00:00:00 2001 From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com> Date: Sat, 30 Dec 2023 11:53:25 +0100 Subject: [PATCH] Fixed No price set for shop item in arena {0} skipping item --- .github/CHANGELOG.md | 2 ++ .../projects/villagedefense/arena/managers/ShopManager.java | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 7b50d702d..5abe83c61 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -8,6 +8,8 @@ deploy webhooks to print changelog successfully `` That's all, matcher will stop when detects next line started with `###` match +### 4.7.2 (30.12.2023) +* Fixed No price set for shop item on all locales ### 4.7.0 (10.08.2023) * Added up to 1.20 compatibility diff --git a/src/main/java/plugily/projects/villagedefense/arena/managers/ShopManager.java b/src/main/java/plugily/projects/villagedefense/arena/managers/ShopManager.java index 824afcd51..2f2fe70a0 100644 --- a/src/main/java/plugily/projects/villagedefense/arena/managers/ShopManager.java +++ b/src/main/java/plugily/projects/villagedefense/arena/managers/ShopManager.java @@ -133,15 +133,15 @@ private void registerShop() { ItemMeta meta = itemStack.getItemMeta(); //seek for item price if(meta != null && meta.hasLore()) { - String currency = new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_SHOP_CURRENCY").asKey().build(); + String currency = ChatColor.stripColor(new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_SHOP_CURRENCY").asKey().build()); for(String s : ComplementAccessor.getComplement().getLore(meta)) { if(s.contains(currency) || s.contains("orbs")) { - costString = ChatColor.stripColor(s).replace(currency, ""); + costString = ChatColor.stripColor(s).replace(currency, "").replace("orbs", "").trim(); break; } } } - + plugin.getDebugger().debug(Level.INFO, "{0} Coststring {1} of slot {2} !", arena.getId(), costString, slot); int cost; try { cost = Integer.parseInt(costString);