Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 11:00:06 +01:00
Use API method to create offset command completions
Dieser Commit ist enthalten in:
Ursprung
2bc7d1df25
Commit
a5b9c7b3ee
@ -48,9 +48,8 @@ public class BukkitCommandWrapper implements com.mojang.brigadier.Command<Comman
|
|||||||
public CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandListenerWrapper> context, SuggestionsBuilder builder) throws CommandSyntaxException {
|
public CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandListenerWrapper> context, SuggestionsBuilder builder) throws CommandSyntaxException {
|
||||||
List<String> results = server.tabComplete(context.getSource().getBukkitSender(), builder.getInput(), context.getSource().getWorld(), context.getSource().getPosition(), true);
|
List<String> results = server.tabComplete(context.getSource().getBukkitSender(), builder.getInput(), context.getSource().getWorld(), context.getSource().getPosition(), true);
|
||||||
|
|
||||||
// These are normally only set based on sub nodes, but we have just one giant args node
|
// Defaults to sub nodes, but we have just one giant args node, so offset accordingly
|
||||||
builder.start = builder.getInput().lastIndexOf(' ') + 1;
|
builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1);
|
||||||
builder.remaining = builder.getInput().substring(builder.start);
|
|
||||||
|
|
||||||
for (String s : results) {
|
for (String s : results) {
|
||||||
builder.suggest(s);
|
builder.suggest(s);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren