3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Parse with square brackets after a % modifier

- Fixes #1409
Dieser Commit ist enthalten in:
dordsor21 2021-11-16 14:32:25 +00:00
Ursprung 66357b8adb
Commit 5692ec54dd
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -114,10 +114,14 @@ public class RichPatternParser extends FaweParser<Pattern> {
chance = Expression.compile(command.substring(0, percentIndex)).evaluate(); chance = Expression.compile(command.substring(0, percentIndex)).evaluate();
String value = command.substring(percentIndex + 1); String value = command.substring(percentIndex + 1);
if (!entry.getValue().isEmpty()) { if (!entry.getValue().isEmpty()) {
if (!value.isEmpty()) { boolean addBrackets = !value.isEmpty();
value += " "; if (addBrackets) {
value += "[";
} }
value += StringMan.join(entry.getValue(), " "); value += StringMan.join(entry.getValue(), " ");
if (addBrackets) {
value += "]";
}
} }
pattern = parseFromInput(value, context); pattern = parseFromInput(value, context);
} else { // legacy block pattern } else { // legacy block pattern