diff --git a/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/cheat/CheatCommand.java b/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/cheat/CheatCommand.java index dd031e6ca..f9197db45 100644 --- a/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/cheat/CheatCommand.java +++ b/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/cheat/CheatCommand.java @@ -90,7 +90,7 @@ protected void construct(Command.Builder 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(); @@ -264,19 +264,19 @@ protected void construct(Command.Builder commandSenderWrapperBuil }) ); + var teamArgument = StringArgument.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.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(); diff --git a/plugin/universal/build.gradle b/plugin/universal/build.gradle index aba7f09ab..2236cd4e8 100644 --- a/plugin/universal/build.gradle +++ b/plugin/universal/build.gradle @@ -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)