Don't ask for player
This commit is contained in:
parent
56010fb9ad
commit
8d6efe0265
|
|
@ -31,21 +31,6 @@ public class Report {
|
|||
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
|
||||
.<CommandSource>literal("report")
|
||||
.requires(ctx -> ctx.hasPermission("command.chat.report"))
|
||||
.then(RequiredArgumentBuilder.<CommandSource, String>argument("username", StringArgumentType.string())
|
||||
.suggests((context, builder) -> {
|
||||
Collection<String> possibleValues = new ArrayList<>();
|
||||
for (Player player : proxyServer.getAllPlayers()) {
|
||||
possibleValues.add(player.getGameProfile().getName());
|
||||
}
|
||||
if(possibleValues.isEmpty()) return Suggestions.empty();
|
||||
String remaining = builder.getRemaining().toLowerCase();
|
||||
for (String str : possibleValues) {
|
||||
if (str.toLowerCase().startsWith(remaining)) {
|
||||
builder.suggest(StringArgumentType.escapeIfRequired(str));
|
||||
}
|
||||
}
|
||||
return builder.buildFuture();
|
||||
})
|
||||
.then(RequiredArgumentBuilder
|
||||
.<CommandSource, String>argument("report", StringArgumentType.greedyString())
|
||||
.executes(context -> {
|
||||
|
|
@ -79,7 +64,6 @@ public class Report {
|
|||
return 1;
|
||||
})
|
||||
)
|
||||
)
|
||||
.executes(context -> 0)
|
||||
.build();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user