mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-03 14:02:01 +01:00
Replace $/{ in shop placeholders
This commit is contained in:
parent
19f08c4607
commit
f498391c1f
@ -446,8 +446,11 @@ public class ShopTrait extends Trait {
|
|||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
Matcher matcher = PLACEHOLDER_REGEX.matcher(string);
|
Matcher matcher = PLACEHOLDER_REGEX.matcher(string);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
matcher.appendReplacement(sb, Joiner.on(", ").join(
|
matcher.appendReplacement(sb,
|
||||||
Iterables.transform(matcher.group(1).equals("cost") ? cost : result, NPCShopAction::describe)));
|
Joiner.on(", ")
|
||||||
|
.join(Iterables.transform(matcher.group(1).equalsIgnoreCase("cost") ? cost : result,
|
||||||
|
NPCShopAction::describe))
|
||||||
|
.replace("$", "\\$").replace("{", "\\{"));
|
||||||
}
|
}
|
||||||
matcher.appendTail(sb);
|
matcher.appendTail(sb);
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user