Skip to content

Commit

Permalink
Fixed shop price for all kinds of locales
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigerpanzer02 committed Aug 11, 2023
1 parent 6f9925d commit a9443c2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ 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();
for(String s : ComplementAccessor.getComplement().getLore(meta)) {
if(s.contains(new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_SHOP_CURRENCY").asKey().build()) || s.contains("orbs")) {
costString = ChatColor.stripColor(s).replaceAll("&[0-9a-zA-Z]", "").replaceAll("[^0-9]", "");
if(s.contains(currency) || s.contains("orbs")) {
costString = ChatColor.stripColor(s).replace(currency, "");
break;
}
}
Expand Down

0 comments on commit a9443c2

Please sign in to comment.