Skip to content

Commit

Permalink
Case-insensitive command suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Aug 17, 2022
1 parent 3ccc662 commit 10156f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/folk/sisby/switchy/SwitchyCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.quiltmc.qsl.command.api.CommandRegistrationCallback;

import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -76,7 +76,7 @@ private static CompletableFuture<Suggestions> suggestPresets(CommandContext<Serv

if (((SwitchyPlayer) player).switchy$getPresets() != null) {
((SwitchyPlayer) player).switchy$getPresets().getPresetNames().stream()
.filter((s) -> s.startsWith(remaining))
.filter((s) -> s.toLowerCase(Locale.ROOT).startsWith(remaining))
.forEach(builder::suggest);
}

Expand Down

0 comments on commit 10156f2

Please sign in to comment.