public class UnquotedStringParseRule implements Rule<StringReader, String> {
11
private final int minSize;
12
private final DelayedException<CommandSyntaxException> error;
13
14
public UnquotedStringParseRule(final int minSize, final DelayedException<CommandSyntaxException> error) {
15
this.minSize = minSize;
16
this.error = error;
17
}
18
19
public @Nullable String parse(final ParseState<StringReader> state) {
20
state.input().skipWhitespace();
21
int cursor = state.mark();
22
String value = state.input().readUnquotedString();
23
if (value.length() < this.minSize) {
24
state.errorCollector().store(cursor, this.error);
25
return null;
26
} else {
27
return value;
28
}
29
}
30
}
31
Decompiled Minecraft 26.3 source of UnquotedStringParseRule (net/minecraft/util/parsing/packrat/commands/UnquotedStringParseRule.java) with Mojang official mappings, stored verbatim on the site.