Skip to content

Commit

Permalink
Fixed No price set for shop item in arena {0} skipping item
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigerpanzer02 committed Dec 30, 2023
1 parent b268468 commit 72857cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ deploy webhooks to print changelog successfully
`<update log line>`

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 72857cb

Please sign in to comment.