Deprecate argument newBuilder methods and add builder methods to align with newer arguments (#419)

This commit is contained in:
Jason 2022-12-13 08:54:54 -07:00
parent 306a1def9a
commit 99d388b708
39 changed files with 634 additions and 204 deletions

View file

@ -129,7 +129,7 @@ public final class FabricClientExample implements ClientModInitializer {
commandManager.command(base.literal("flag_test")
.argument(StringArgument.optional("parameter"))
.flag(CommandFlag.newBuilder("flag").withAliases("f"))
.flag(CommandFlag.builder("flag").withAliases("f"))
.handler(ctx -> ctx.getSender().sendFeedback(Component.literal("Had flag: " + ctx.flags().isPresent("flag")))));
}

View file

@ -78,7 +78,7 @@ public final class FabricExample implements ModInitializer {
final Command.Builder<CommandSourceStack> base = manager.commandBuilder("cloudtest");
final CommandArgument<CommandSourceStack, String> name = StringArgument.of("name");
final CommandArgument<CommandSourceStack, Integer> hugs = IntegerArgument.<CommandSourceStack>newBuilder("hugs")
final CommandArgument<CommandSourceStack, Integer> hugs = IntegerArgument.<CommandSourceStack>builder("hugs")
.asOptionalWithDefault("1")
.build();
@ -148,7 +148,7 @@ public final class FabricExample implements ModInitializer {
.permission("cloud.give")
.argument(MultiplePlayerSelectorArgument.of("targets"))
.argument(ItemInputArgument.of("item"))
.argument(IntegerArgument.<CommandSourceStack>newBuilder("amount")
.argument(IntegerArgument.<CommandSourceStack>builder("amount")
.withMin(1)
.asOptionalWithDefault("1"))
.handler(ctx -> {