Skip to content

Commit

Permalink
fix: cheat command
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 committed Jan 16, 2024
1 parent 1e5af0f commit 85c0e40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected void construct(Command.Builder<CommandSender> commandSenderWrapperBuil
return game.getGameVariant().getItemSpawnerTypeNames();
})
)
.argument(IntegerArgument.optional("amount", 1))
.argument(this.allowConsole ? IntegerArgument.of("amount") : IntegerArgument.optional("amount", 1))
.argument(constructPlayerArgument(manager))
.handler(commandContext -> {
var sender = commandContext.getSender();
Expand Down Expand Up @@ -264,19 +264,19 @@ protected void construct(Command.Builder<CommandSender> commandSenderWrapperBuil
})
);

var teamArgument = StringArgument.<CommandSender>newBuilder("team")
.withSuggestionsProvider((c, s) -> {
var game = getGameForSuggestionProvider(c);
if (game == null) {
return List.of();
}

return game.getActiveTeams().stream().map(TeamImpl::getName).collect(Collectors.toList());
});

manager.command(commandSenderWrapperBuilder
.literal("joinTeam")
.argument(StringArgument.<CommandSender>newBuilder("team")
.withSuggestionsProvider((c, s) -> {
var game = getGameForSuggestionProvider(c);
if (game == null) {
return List.of();
}

return game.getActiveTeams().stream().map(TeamImpl::getName).collect(Collectors.toList());
})
.asOptional()
)
.argument(this.allowConsole ? teamArgument : teamArgument.asOptional())
.argument(constructPlayerArgument(manager))
.handler(commandContext -> {
var sender = commandContext.getSender();
Expand Down
2 changes: 1 addition & 1 deletion plugin/universal/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
prepareTestTask()
.versions('1.20.2', '1.20.1', '1.19.4', '1.19.3', '1.18.2', '1.17.1', '1.16.5', '1.15.2', '1.14.4', '1.13.2', '1.12.2', '1.11.2', '1.10.2', '1.9.4', '1.8.8')
.versions('1.20.4', '1.20.2', '1.20.1', '1.19.4', '1.19.3', '1.18.2', '1.17.1', '1.16.5', '1.15.2', '1.14.4', '1.13.2', '1.12.2', '1.11.2', '1.10.2', '1.9.4', '1.8.8')
.setSubdirectory('paper-master')
.jvmArgs('-Dio.papermc.paper.suppress.sout.nags=true', '-DPaper.IgnoreJavaVersion=true') // suppress System.out.println nag
.onlineMode(false)
Expand Down

0 comments on commit 85c0e40

Please sign in to comment.