Use rootian locale for case conversion.
This commit is contained in:
parent
60a94e529d
commit
cf754c4ef6
3 changed files with 6 additions and 3 deletions
|
@ -20,6 +20,7 @@ import java.util.Collections;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -588,7 +589,7 @@ public class CommandDispatcher<S> {
|
|||
|
||||
final String fullInput = parse.getReader().getString();
|
||||
final String truncatedInput = fullInput.substring(0, cursor);
|
||||
final String truncatedInputLowerCase = truncatedInput.toLowerCase();
|
||||
final String truncatedInputLowerCase = truncatedInput.toLowerCase(Locale.ROOT);
|
||||
@SuppressWarnings("unchecked") final CompletableFuture<Suggestions>[] futures = new CompletableFuture[parent.getChildren().size()];
|
||||
int i = 0;
|
||||
for (final CommandNode<S> node : parent.getChildren()) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.mojang.brigadier.context.StringRange;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class SuggestionsBuilder {
|
||||
|
@ -27,7 +28,7 @@ public class SuggestionsBuilder {
|
|||
}
|
||||
|
||||
public SuggestionsBuilder(final String input, final int start) {
|
||||
this(input, input.toLowerCase(), start);
|
||||
this(input, input.toLowerCase(Locale.ROOT), start);
|
||||
}
|
||||
|
||||
public String getInput() {
|
||||
|
|
|
@ -16,6 +16,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
@ -26,7 +27,7 @@ public class LiteralCommandNode<S> extends CommandNode<S> {
|
|||
public LiteralCommandNode(final String literal, final Command<S> command, final Predicate<S> requirement, final CommandNode<S> redirect, final RedirectModifier<S> modifier, final boolean forks) {
|
||||
super(command, requirement, redirect, modifier, forks);
|
||||
this.literal = literal;
|
||||
this.literalLowerCase = literal.toLowerCase();
|
||||
this.literalLowerCase = literal.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
public String getLiteral() {
|
||||
|
|
Loading…
Reference in a new issue